| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 7 | 7 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 0 | 1 | 6 | 0% |
What each file covers
Sections
0 shared · 7 only in A · 7 only in B- − LangGraph.js
- − Overview
- − Core Concepts
- − Key Features
- − Development Practices
- − Deployment
- − Relevant Files in this Project
- + Headers
- + PROJECT DOCUMENTATION & CONTEXT SYSTEM
- + TECH STACK
- + CODING STANDARDS
- + Environment Variables
- + DEBUGGING
- + WORKFLOW & RELEASE RULES
Commands
neither file has anySection tags
0 shared · 1 only in A · 6 only in B- − architecture
- + setup
- + security
- + deployment
- + do-not
- + agent-behaviour
- + docs
Line diff
ssdeanx/langgraph-dm · .clinerules/langgraphjs.md
@@ −1 @@
1---
2glob: "**/*.ts"
3description: "Langgraphjs Architecture"
4---
5# LangGraph.js
6
7## Overview
8
9LangGraph.js is a powerful library for building stateful, multi-actor AI applications with Large Language Models (LLMs). It allows you to model complex agent workflows as graphs, where nodes represent individual steps or agents and edges define the flow of information and control.
10
11## Core Concepts
12
13* **StateGraph:** The primary class for defining graph-based workflows. It manages the shared state that is passed between nodes.
14* **Nodes:** Functions or runnable components that perform specific tasks and update the graph's state.
15* **Edges:** Define transitions between nodes, which can be unconditional or conditional based on the current state.
16* **State:** A shared data structure (`AgentState`) that represents the current context of the application, updated by nodes and passed along edges.
17* **Checkpoints:** Snapshots of the graph's state saved at various points, enabling persistence, debugging, and human-in-the-loop interactions.
18* **Subgraphs:** The ability to embed one graph as a node within another, promoting modularity and hierarchical design.
19* **Command Primitive:** A mechanism for combining state updates and dynamic control flow within a single node.
20* **Streaming:** First-class support for streaming intermediate results and LLM tokens, enhancing user experience.
21* **Human-in-the-Loop (HIL):** Features like `interrupt()` and breakpoints allow human intervention for approvals, state editing, and dynamic input.
22
23## Key Features
24
25* **Controllability:** Fine-grained control over the application's flow through explicit node and edge definitions.
26* **Persistence:** Built-in mechanisms for saving and restoring graph state, supporting long-running conversations and fault tolerance.
27* **Modularity:** Encourages breaking down complex problems into smaller, reusable components (nodes and subgraphs).
28* **Tool Integration:** Seamlessly integrates with LangChain tools, allowing agents to interact with external systems.
29* **Observability:** Integrates with LangSmith for tracing, debugging, and monitoring of LLM applications.
30
31## Development Practices
32
33* **TypeScript:** Strongly typed development for improved code quality and maintainability.
34* **Testing:** Encourages comprehensive unit and integration testing of nodes, agents, and overall graph workflows.
35* **Error Handling:** Robust error handling for tool calls and model invocations.
36
37## Deployment
38
39LangGraph.js applications can be deployed in various ways, including self-hosted solutions or through the LangGraph Platform (Cloud, BYOC). The LangGraph CLI and SDK provide tools for building, running, and interacting with deployed applications.
40
41## Relevant Files in this Project
42
43* `src/agent/graph.ts`: Defines the main `StateGraph` and its nodes/edges, orchestrating the agent workflow.
44* `src/agent/state.ts`: Defines the `AgentState` interface and `AgentAnnotation` for managing the application's state.
45* `src/agent/supervisor.ts`: Implements the supervisor agent for routing between specialized agents.
46* `src/agent/react_agent.ts`: Implements the ReAct (Reasoning and Acting) agent.
47* `src/memory/`: Contains implementations for memory management, including MongoDB integration for checkpoints and vector stores.
48* `src/tools/`: Houses various tools used by the agents (e.g., `calculator`, `document_processing`, `exa`, `github`, `local_git`, `tavily`, `web_scraping`).
49* `package.json`: Lists LangGraph and LangChain related dependencies.
50
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: "Langgraphjs Architecture"
2+description: AI rules derived by SpecStory from the project AI interaction history
3+globs: *
44 ---
5−# LangGraph.js
65
7−## Overview
6+## Headers
87
9−LangGraph.js is a powerful library for building stateful, multi-actor AI applications with Large Language Models (LLMs). It allows you to model complex agent workflows as graphs, where nodes represent individual steps or agents and edges define the flow of information and control.
8+## PROJECT DOCUMENTATION & CONTEXT SYSTEM
109
11−## Core Concepts
10+## TECH STACK
1211
13−* **StateGraph:** The primary class for defining graph-based workflows. It manages the shared state that is passed between nodes.
14−* **Nodes:** Functions or runnable components that perform specific tasks and update the graph's state.
15−* **Edges:** Define transitions between nodes, which can be unconditional or conditional based on the current state.
16−* **State:** A shared data structure (`AgentState`) that represents the current context of the application, updated by nodes and passed along edges.
17−* **Checkpoints:** Snapshots of the graph's state saved at various points, enabling persistence, debugging, and human-in-the-loop interactions.
18−* **Subgraphs:** The ability to embed one graph as a node within another, promoting modularity and hierarchical design.
19−* **Command Primitive:** A mechanism for combining state updates and dynamic control flow within a single node.
20−* **Streaming:** First-class support for streaming intermediate results and LLM tokens, enhancing user experience.
21−* **Human-in-the-Loop (HIL):** Features like `interrupt()` and breakpoints allow human intervention for approvals, state editing, and dynamic input.
12+## CODING STANDARDS
2213
23−## Key Features
14+### Environment Variables
2415
25−* **Controllability:** Fine-grained control over the application's flow through explicit node and edge definitions.
26−* **Persistence:** Built-in mechanisms for saving and restoring graph state, supporting long-running conversations and fault tolerance.
27−* **Modularity:** Encourages breaking down complex problems into smaller, reusable components (nodes and subgraphs).
28−* **Tool Integration:** Seamlessly integrates with LangChain tools, allowing agents to interact with external systems.
29−* **Observability:** Integrates with LangSmith for tracing, debugging, and monitoring of LLM applications.
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:
3019
31−## Development Practices
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+ }
3228
33−* **TypeScript:** Strongly typed development for improved code quality and maintainability.
34−* **Testing:** Encourages comprehensive unit and integration testing of nodes, agents, and overall graph workflows.
35−* **Error Handling:** Robust error handling for tool calls and model invocations.
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.
3635
37−## Deployment
36+## DEBUGGING
3837
39−LangGraph.js applications can be deployed in various ways, including self-hosted solutions or through the LangGraph Platform (Cloud, BYOC). The LangGraph CLI and SDK provide tools for building, running, and interacting with deployed applications.
40−
41−## Relevant Files in this Project
42−
43−* `src/agent/graph.ts`: Defines the main `StateGraph` and its nodes/edges, orchestrating the agent workflow.
44−* `src/agent/state.ts`: Defines the `AgentState` interface and `AgentAnnotation` for managing the application's state.
45−* `src/agent/supervisor.ts`: Implements the supervisor agent for routing between specialized agents.
46−* `src/agent/react_agent.ts`: Implements the ReAct (Reasoning and Acting) agent.
47−* `src/memory/`: Contains implementations for memory management, including MongoDB integration for checkpoints and vector stores.
48−* `src/tools/`: Houses various tools used by the agents (e.g., `calculator`, `document_processing`, `exa`, `github`, `local_git`, `tavily`, `web_scraping`).
49−* `package.json`: Lists LangGraph and LangChain related dependencies.
50−
38+## WORKFLOW & RELEASE RULES
