A ReAct agent backend for developer portfolio chatbots. Built with LangGraph, RAG and FastAPI.
Live demo: prashantnathv2.netlify.app
See docs/architecture/
- Answers questions about you using a RAG knowledge base (Pinecone)
- Fetches your live GitHub repositories on demand
- Captures visitor contact details to Supabase
- Streams responses token by token via SSE
- Remembers context within a conversation session
| Layer | Technology |
|---|---|
| Framework | FastAPI |
| Agent | LangGraph (ReAct pattern) |
| LLM | OpenAI gpt-4o-mini |
| Embeddings | OpenAI text-embedding-3-small |
| Vector Store | Pinecone |
| Database | Supabase (PostgreSQL) |
| Memory | LangGraph MemorySaver |
| Streaming | Server-Sent Events (SSE) |
app/
├── agent/
│ ├── graph.py # LangGraph graph assembly
│ ├── nodes.py # llm_node and tool_node
│ ├── prompt.py # System prompt
│ └── state.py # Agent state schema
├── api/
│ ├── api_service/
│ │ └── chat_service.py # SSE streaming logic
│ └── routes/
│ └── chat_router.py # /chat endpoint
├── core/
│ └── config.py # Environment variables settings
├── services/
│ ├── pinecone_service.py
│ └── supabase_service.py
└── tools/
├── rag_tool.py
├── github_tool.py
└── user_capture_tool.py
scripts/
└── indexing.py # Knowledge base ingestion
git clone https://github.com/prashant00797/personal-chat-agent
cd personal-chat-agentcp .env.example .envFill in your values:
OPENAI_API_KEY=
PINECONE_API_KEY=
PINECONE_INDEX_NAME=
PINECONE_HOST=
SUPABASE_URL=
SUPABASE_KEY=
GITHUB_BASE_URL=https://api.github.com/users/YOUR_USERNAME/repos
STREAM_DELAY=
DUMMY_HEALTH_CHECK_BOT_ID=
Create a PDF with information about yourself — experience, skills, projects, availability, preferences. Place it at:
knowledge_base/your_name_kb.pdf
uv run python -m scripts.indexingThis embeds your document and pushes vectors to Pinecone.
Edit app/agent/prompt.py — replace Prashant's details with your own name, contact info and persona.
uv run uvicorn main:app --reloadAPI available at http://localhost:8000
Swagger docs at http://localhost:8000/docs
Streams a chat response as SSE.
Request:
{
"message": "What is your experience with React?",
"thread_id": "uuid-string"
}SSE Events:
data: {"type": "tool_call", "tool": "retrieve_relevant_chunks"}
data: {"type": "token", "content": "Prashant"}
data: {"type": "end"}
data: {"type": "error", "message": "..."}
Tested on Render free tier.
Start command:
uvicorn main:app --host 0.0.0.0 --port $PORT
Add all environment variables in Render dashboard under Environment.
- Python 3.11+
- uv package manager
- Pinecone account (free tier works)
- Supabase account (free tier works)
- OpenAI API key
The Next.js chat widget frontend is in a separate repo: my-portfolio-v2