Skip to content

Commit f22d66b

Browse files
Merge pull request #6 from KasarLabs/feat/add-langsmith-support
Add langsmith support and update documentation about it.
2 parents 9879280 + 6715e8c commit f22d66b

File tree

5 files changed

+77
-50
lines changed

5 files changed

+77
-50
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,25 @@ There are mainly 2 ways of installing Cairo Coder - With Docker, Without Docker.
117117
database, while the second is used by your application to connect to it.
118118

119119

120-
7. Run the application using one of the following methods:
120+
7. **Configure LangSmith (Optional)**
121+
122+
Cairo Coder can use LangSmith to record and monitor LLM calls. This step is optional but recommended for development and debugging.
123+
124+
- Create an account at [LangSmith](https://smith.langchain.com/)
125+
- Create a new project in the LangSmith dashboard
126+
- Retrieve your API credentials
127+
- Create a `.env` file in the `packages/backend` directory with the following variables:
128+
```
129+
LANGSMITH_TRACING=true
130+
LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
131+
LANGSMITH_API_KEY="<your-api-key>"
132+
LANGCHAIN_PROJECT="<your-project-name>"
133+
```
134+
135+
With this configuration, all LLM calls and chain executions will be logged to your LangSmith project, allowing you to debug, analyze, and improve the system's performance.
136+
137+
138+
9. Run the application using one of the following methods:
121139

122140
```bash
123141
docker-compose up --build

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
- 3001:3001
2424
extra_hosts:
2525
- host.docker.internal:host-gateway
26+
env_file:
27+
- packages/backend/.env
2628
depends_on:
2729
postgres:
2830
condition: service_started

packages/backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"check-types": "tsc --noEmit"
1313
},
1414
"dependencies": {
15+
"@cairo-coder/agents": "workspace:*",
1516
"@iarna/toml": "^2.2.5",
1617
"@langchain/anthropic": "^0.2.18",
1718
"@langchain/community": "^0.3.32",
1819
"@langchain/core": "^0.2.36",
1920
"@langchain/google-genai": "^0.1.8",
2021
"@langchain/openai": "^0.0.25",
21-
"@cairo-coder/agents": "workspace:*",
2222
"@types/node": "^20",
2323
"cors": "^2.8.5",
24+
"dotenv": "^16.4.7",
2425
"express": "^4.21.2",
2526
"node-fetch": "2.7.0",
2627
"uuid": "^11.1.0",

packages/backend/src/app.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { createApplication } from './server';
22
import { logger } from '@cairo-coder/agents/utils/index';
3+
import dotenv from 'dotenv';
4+
5+
dotenv.config();
36

47
// Error handling for uncaught exceptions
58
process.on('uncaughtException', (err, origin) => {

pnpm-lock.yaml

Lines changed: 51 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)