Skip to content

Commit 57fa0eb

Browse files
committed
feat: add langchain,langgraph,langsmith, update python version to 3.11
1 parent 2cbda28 commit 57fa0eb

37 files changed

+2779
-365
lines changed

.env.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ STACK_NAME=full-stack-fastapi-project
1818

1919
# Backend
2020
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com"
21+
# python -c "import secrets; print(secrets.token_urlsafe(32))"
2122
SECRET_KEY=changethis
2223
FIRST_SUPERUSER=admin@example.com
2324
FIRST_SUPERUSER_PASSWORD=changethis
@@ -38,6 +39,22 @@ POSTGRES_DB=app
3839
POSTGRES_USER=postgres
3940
POSTGRES_PASSWORD=changethis
4041

42+
# LLM
43+
OPENAI_API_KEY=
44+
OPENAI_BASE_URL=
45+
ANTHROPIC_API_KEY=
46+
ANTHROPIC_BASE_URL=
47+
48+
LLM_PROVIDER_DEFAULT=openai
49+
LLM_MODEL_OPENAI_DEFAULT=gpt-5.4
50+
LLM_MODEL_ANTHROPIC_DEFAULT=claude-sonnet-4-5
51+
52+
# LangSmith
53+
LANGSMITH_TRACING=true
54+
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
55+
LANGSMITH_API_KEY=<your-api-key>
56+
LANGSMITH_PROJECT="ontology-py"
57+
4158
SENTRY_DSN=
4259

4360
# Configure these with your own Docker registry images

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- uses: oven-sh/setup-bun@v2
5252
- uses: actions/setup-python@v6
5353
with:
54-
python-version: '3.10'
54+
python-version: '3.11'
5555
- name: Setup tmate session
5656
uses: mxschmitt/action-tmate@v3
5757
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}

.github/workflows/test-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v6
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.11"
2222
- name: Install uv
2323
uses: astral-sh/setup-uv@v7
2424
- run: docker compose down -v --remove-orphans

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ node_modules/
1111
.evn.local
1212

1313
.worktrees
14+
15+
.langgraph_api/

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Agent guidance for working in `full-stack-fastapi-template`.
2727
## Tooling
2828

2929
- Python package management: `uv`
30-
- Python version: `>=3.10,<4.0`
30+
- Python version: `>=3.11,<4.0`
3131
- Backend linting/formatting: `ruff`
3232
- Backend type checking: `mypy --strict`
3333
- Backend testing: `pytest` with `coverage`

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10
1+
FROM python:3.11
22

33
ENV PYTHONUNBUFFERED=1
44

backend/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* [Docker](https://www.docker.com/).
66
* [uv](https://docs.astral.sh/uv/) for Python package and environment management.
7+
* Python 3.11+ for local LangGraph CLI development.
78

89
## Docker Compose
910

@@ -29,6 +30,42 @@ Make sure your editor is using the correct Python virtual environment, with the
2930

3031
Modify or add SQLModel models for data and SQL tables in `./backend/app/models.py`, API endpoints in `./backend/app/api/`, CRUD (Create, Read, Update, Delete) utils in `./backend/app/crud.py`.
3132

33+
## LangGraph Local Development
34+
35+
The backend now includes a minimal LangChain/LangGraph agent skeleton under `./backend/app/ai/`.
36+
37+
To start the LangGraph local development server:
38+
39+
```console
40+
$ cd backend
41+
$ uv run langgraph dev
42+
```
43+
44+
The CLI configuration lives in `./backend/langgraph.json` and loads environment variables from the repository root `../.env`. The exported agent currently points directly at `./backend/app/ai/agents/chat/graph.py`.
45+
46+
The chat agent keeps its prompt, tools, and graph export under `./backend/app/ai/agents/chat/`, while shared helpers live under `./backend/app/ai/shared/`.
47+
48+
Relevant environment variables in the repository root `.env`:
49+
50+
```dotenv
51+
# LLM
52+
OPENAI_API_KEY=
53+
OPENAI_BASE_URL=
54+
ANTHROPIC_API_KEY=
55+
ANTHROPIC_BASE_URL=
56+
LLM_PROVIDER_DEFAULT=openai
57+
LLM_MODEL_OPENAI_DEFAULT=gpt-4.1-mini
58+
LLM_MODEL_ANTHROPIC_DEFAULT=claude-3-5-haiku-latest
59+
60+
# LangSmith
61+
LANGSMITH_TRACING=true
62+
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
63+
LANGSMITH_API_KEY=
64+
LANGSMITH_PROJECT="ontology-py"
65+
```
66+
67+
Use `OPENAI_BASE_URL` or `ANTHROPIC_BASE_URL` when you need a custom provider endpoint. Set `LANGSMITH_API_KEY` when you want to connect LangGraph Studio to the local server.
68+
3269
## VS Code
3370

3471
There are already configurations in place to run the backend through the VS Code debugger, so that you can use breakpoints, pause and explore variables, etc.

backend/app/ai/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""AI package with shared helpers and agent-specific modules."""

backend/app/ai/agents/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Agent implementations and their private assets."""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Chat agent implementation."""

0 commit comments

Comments
 (0)