| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 5 | 7 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 1 | 5 | 14% |
What each file covers
Sections
0 shared · 5 only in A · 7 only in B- − Agents Guidelines
- − Agent Responsibilities
- − Agent Development Principles
- − Agent Architectures
- − Agent Type Definitions (`src/agent/state.ts`)
- + Headers
- + PROJECT DOCUMENTATION & CONTEXT SYSTEM
- + TECH STACK
- + CODING STANDARDS
- + Environment Variables
- + DEBUGGING
- + WORKFLOW & RELEASE RULES
Commands
neither file has anySection tags
1 shared · 1 only in A · 5 only in B- − types
- + setup
- + security
- + deployment
- + do-not
- + docs
- agent-behaviour
Line diff
ssdeanx/langgraph-dm · .clinerules/agents.md
@@ −1 @@
1---
2glob: "**/*.ts"
3description: "Langgraph Agents Guidelines"
4---
5# Agents Guidelines
6
7## Agent Responsibilities
8
9* **Supervisor:** Acts as the central orchestrator (`src/agent/supervisor.ts`), directing the flow between specialized agents based on the current state and user intent. It should be robust in decision-making and error recovery.
10* **Specialized Agents:** Each agent (e.g., `reactAgent`, `research_agent`, `documentation_agent`) should have a clearly defined purpose and set of tools. They should focus on their specific domain, update the `AgentState` with their results, and return control to the supervisor upon completion or if an unhandled error occurs.
11* **Chat Agent (`chatNode`):** Provides general conversational responses and acts as a fallback for queries not requiring specialized agent intervention.
12* **Tool-Calling Agent (ReAct):** Uses an LLM to decide the control flow, selecting and using various tools, retaining memory, and planning multi-step actions.
13
14## Agent Development Principles
15
16* **Modularity:** Each agent should be a self-contained unit, with its own logic and potentially its own set of tools. This facilitates reusability and easier debugging.
17* **State Management:** Agents must correctly interact with and update the `AgentState` to ensure continuity and accurate context passing throughout the graph. Use `Annotation` and reducers for precise state modifications.
18* **Tool Integration:** Agents should seamlessly integrate and utilize the available tools (`src/tools/*`) to perform their tasks. Ensure proper input validation and error handling when calling tools. Consider `ToolNode` for simplified tool execution.
19* **Error Handling:** Implement agent-specific error handling to gracefully manage failures and report back to the supervisor or user.
20* **Logging:** Use the `winston` logger (`src/config/logger.ts`) for tracing agent execution, decisions, and tool calls.
21* **Control Flow:** Agents can return `Command` objects to combine state updates and dynamic routing (e.g., handoffs between agents).
22* **Human-in-the-Loop:** Design agents to support human intervention for approvals, state editing, or input collection using LangGraph's `interrupt()` function.
23
24## Agent Architectures
25
26* **Router:** LLM selects a single path from options.
27* **Tool-Calling Agent (ReAct):** Combines tool usage, memory, and planning for multi-step decision-making.
28* **Multi-Agent Systems:** Break down complex problems into smaller, independent agents collaborating via networks, supervisors, or hierarchical structures. Handoffs are crucial for communication.
29
30## Agent Type Definitions (`src/agent/state.ts`)
31
32* The `AgentType` enum defines the various types of agents supported in the system, enabling clear categorization and routing within the `StateGraph`.
33* When adding new agent types, ensure they are properly defined in `AgentType` and integrated into the `StateGraph` in `src/agent/graph.ts`.
34
ssdeanx/langgraph-dm · .github/copilot-instructions.md
@@ +1 @@
1---
2description: AI rules derived by SpecStory from the project AI interaction history
3globs: *
4---
5
6## Headers
7
8## PROJECT DOCUMENTATION & CONTEXT SYSTEM
9
10## TECH STACK
11
12## CODING STANDARDS
13
14### Environment Variables
15
16* Avoid direct use of `process.env` or `import.meta.env` in the main code.
17* Use a configuration module or utility function to safely access environment variables.
18* Implement error handling to ensure that required environment variables are set. For example:
19
20 ```typescript
21 function getEnvVar(name: string): string {
22 const value = process.env[name];
23 if (!value) {
24 throw new Error(`${name} environment variable is not set.`);
25 }
26 return value;
27 }
28
29 const GOOGLE_API_KEY = getEnvVar("GOOGLE_API_KEY");
30 ```
31* All usages of environment variables must go through the designated utility function (e.g., `getEnvVar`). Direct access via `process.env` or `import.meta.env` elsewhere in the code is prohibited. Only the designated utility function (e.g. `getEnvVar`) should directly access `process.env`.
32* In Node.js environments, use `process.env` instead of `import.meta.env` to access environment variables.
33* When using external libraries, ensure that API keys or other sensitive configuration parameters are not passed directly as properties in constructors, if the library does not expect it. Instead, rely on environment variables or the library's recommended approach for authentication.
34* When using the `ExaSearchResults` class from the `@langchain/exa` library, the API key should not be passed directly to the constructor. Instead, ensure the `EXA_API_KEY` environment variable is set, and instantiate `ExaSearchResults` without the `apiKey` argument in the constructor. The library automatically uses the environment variable if set.
35
36## DEBUGGING
37
38## WORKFLOW & RELEASE RULES
@@ −1 +1 @@
11 ---
2−glob: "**/*.ts"
3−description: "Langgraph Agents Guidelines"
2+description: AI rules derived by SpecStory from the project AI interaction history
3+globs: *
44 ---
5−# Agents Guidelines
65
7−## Agent Responsibilities
6+## Headers
87
9−* **Supervisor:** Acts as the central orchestrator (`src/agent/supervisor.ts`), directing the flow between specialized agents based on the current state and user intent. It should be robust in decision-making and error recovery.
10−* **Specialized Agents:** Each agent (e.g., `reactAgent`, `research_agent`, `documentation_agent`) should have a clearly defined purpose and set of tools. They should focus on their specific domain, update the `AgentState` with their results, and return control to the supervisor upon completion or if an unhandled error occurs.
11−* **Chat Agent (`chatNode`):** Provides general conversational responses and acts as a fallback for queries not requiring specialized agent intervention.
12−* **Tool-Calling Agent (ReAct):** Uses an LLM to decide the control flow, selecting and using various tools, retaining memory, and planning multi-step actions.
8+## PROJECT DOCUMENTATION & CONTEXT SYSTEM
139
14−## Agent Development Principles
10+## TECH STACK
1511
16−* **Modularity:** Each agent should be a self-contained unit, with its own logic and potentially its own set of tools. This facilitates reusability and easier debugging.
17−* **State Management:** Agents must correctly interact with and update the `AgentState` to ensure continuity and accurate context passing throughout the graph. Use `Annotation` and reducers for precise state modifications.
18−* **Tool Integration:** Agents should seamlessly integrate and utilize the available tools (`src/tools/*`) to perform their tasks. Ensure proper input validation and error handling when calling tools. Consider `ToolNode` for simplified tool execution.
19−* **Error Handling:** Implement agent-specific error handling to gracefully manage failures and report back to the supervisor or user.
20−* **Logging:** Use the `winston` logger (`src/config/logger.ts`) for tracing agent execution, decisions, and tool calls.
21−* **Control Flow:** Agents can return `Command` objects to combine state updates and dynamic routing (e.g., handoffs between agents).
22−* **Human-in-the-Loop:** Design agents to support human intervention for approvals, state editing, or input collection using LangGraph's `interrupt()` function.
12+## CODING STANDARDS
2313
24−## Agent Architectures
14+### Environment Variables
2515
26−* **Router:** LLM selects a single path from options.
27−* **Tool-Calling Agent (ReAct):** Combines tool usage, memory, and planning for multi-step decision-making.
28−* **Multi-Agent Systems:** Break down complex problems into smaller, independent agents collaborating via networks, supervisors, or hierarchical structures. Handoffs are crucial for communication.
16+* Avoid direct use of `process.env` or `import.meta.env` in the main code.
17+* Use a configuration module or utility function to safely access environment variables.
18+* Implement error handling to ensure that required environment variables are set. For example:
2919
30−## Agent Type Definitions (`src/agent/state.ts`)
20+ ```typescript
21+ function getEnvVar(name: string): string {
22+ const value = process.env[name];
23+ if (!value) {
24+ throw new Error(`${name} environment variable is not set.`);
25+ }
26+ return value;
27+ }
3128
32−* The `AgentType` enum defines the various types of agents supported in the system, enabling clear categorization and routing within the `StateGraph`.
33−* When adding new agent types, ensure they are properly defined in `AgentType` and integrated into the `StateGraph` in `src/agent/graph.ts`.
29+ const GOOGLE_API_KEY = getEnvVar("GOOGLE_API_KEY");
30+ ```
31+* All usages of environment variables must go through the designated utility function (e.g., `getEnvVar`). Direct access via `process.env` or `import.meta.env` elsewhere in the code is prohibited. Only the designated utility function (e.g. `getEnvVar`) should directly access `process.env`.
32+* In Node.js environments, use `process.env` instead of `import.meta.env` to access environment variables.
33+* When using external libraries, ensure that API keys or other sensitive configuration parameters are not passed directly as properties in constructors, if the library does not expect it. Instead, rely on environment variables or the library's recommended approach for authentication.
34+* When using the `ExaSearchResults` class from the `@langchain/exa` library, the API key should not be passed directly to the constructor. Instead, ensure the `EXA_API_KEY` environment variable is set, and instantiate `ExaSearchResults` without the `apiKey` argument in the constructor. The library automatically uses the environment variable if set.
3435
36+## DEBUGGING
37+
38+## WORKFLOW & RELEASE RULES
