π Quick Start Guide - Agentic AI Backend
Prerequisites
Step 1: Verify Installation β
Dependencies are already installed. Verify with:
python -c "import chromadb, sentence_transformers; print('β
Vector Store packages installed')"
Step 2: Configure Environment π§
Option 1: GitHub Models (Recommended) β
Free, fast, and reliable!
- Get a GitHub token: https://github.com/settings/tokens
- Edit
.env:
Copy-Item .env.template .env
notepad .env
- Add your tokens:
GITHUB_TOKEN=ghp_your_github_token_here
OPENWEATHERMAP_API_KEY=your_weather_api_key_here
See detailed setup: GITHUB_MODELS_SETUP.md
Option 2: Local with Ollama
If you prefer running locally:
- Install a capable Ollama model:
ollama pull llama3.2 # Better than qwen3:0.6b
- Configure
.env:
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2
OPENWEATHERMAP_API_KEY=your_weather_api_key_here
Note: GitHub Models recommended for better reliability and tool calling.
Step 3: Initialize Database πΎ
python seed_data.py
This creates:
Expected output:
Database initialized
Sample meetings created successfully
Step 4: Run Tests π§ͺ
python test_agents.py
This runs 6 comprehensive tests:
- β Weather Agent - Current weather
- β Meeting Agent - Weather-conditional scheduling
- β SQL Agent - Database queries
- β Document RAG - High confidence retrieval
- β Web Fallback - Low confidence web search
- β Specific Retrieval - Precise information extraction
First run will download the embedding model (~80MB) - this is normal!
Step 5: Start the API Server π
python main.py
Server starts at: http://127.0.0.1:8000
API docs available at: http://127.0.0.1:8000/docs
Step 6: Test API Endpoints π‘
Test 1: Weather Query
$body = @{
query = "What's the weather in Paris today?"
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/chat" `
-ContentType "application/json" -Body $body
Test 2: Upload Document
$filePath = "C:\path\to\your\document.pdf"
curl -X POST "http://127.0.0.1:8000/upload" -F "file=@$filePath"
Response will include file_path - use it in the next request.
Test 3: RAG Query
$body = @{
query = "What does the document say about remote work?"
file_path = "D:\python_workspace\multi-agent\uploads\uuid.pdf"
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/chat" `
-ContentType "application/json" -Body $body
Test 4: Meeting Scheduling
$body = @{
query = "Schedule a team meeting tomorrow at 3 PM in London if weather is good. Include Alice and Bob."
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/chat" `
-ContentType "application/json" -Body $body
Test 5: SQL Query
$body = @{
query = "Show me all meetings scheduled for this week"
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/chat" `
-ContentType "application/json" -Body $body
Expected Behavior π―
Weather Agent
Document RAG Agent
Meeting Agent
SQL Agent
Troubleshooting π§
Issue: "No valid LLM configured"
Solution: Ensure Ollama is running at http://localhost:11434
# Check if Ollama is running
Invoke-WebRequest http://localhost:11434
Issue: "Weather API key not configured"
Solution: Add your API key to .env:
OPENWEATHERMAP_API_KEY=your_key_here
Issue: "Document ingestion failed"
Solution: Check file format (PDF/TXT/MD/DOCX) and size (<10MB)
Issue: Slow first RAG query
Expected: First run downloads sentence-transformers model (~80MB) Subsequent queries will be fast.
Issue: Import errors in IDE
Normal: VSCode may show import warnings until packages are fully indexed. Code will run fine.
Understanding the RAG Workflow π
User uploads document.pdf
β
1. Parse with Docling
β
2. Chunk into 500-char pieces (50-char overlap)
β
3. Generate embeddings with sentence-transformers
β
4. Store in ChromaDB (./chroma_db/)
β
User asks: "What is the policy?"
β
5. Search vector store for similar chunks
β
6. Check similarity score
β
βββββββββββββββ¬βββββββββββββββ
β Score β₯ 0.7 β Score < 0.7 β
β (confident) β (uncertain) β
βββββββββββββββ΄βββββββββββββββ
β β
β β
Return doc Search web
answer + combine
results
File Structure π
multi-agent/
βββ main.py # FastAPI server
βββ agents.py # LangGraph agents
βββ tools.py # Agent tools
βββ vector_store.py # ChromaDB manager (NEW)
βββ database.py # SQLite config
βββ models.py # SQLAlchemy models
βββ test_agents.py # Test suite
βββ seed_data.py # DB initialization
βββ .env # Your configuration
βββ .env.template # Configuration template
βββ database.db # SQLite database
βββ chroma_db/ # Vector store (auto-created)
βββ uploads/ # Uploaded documents
βββ IMPLEMENTATION_COMPLETE.md # Full documentation
Next Steps π―
- Explore the API: Visit http://127.0.0.1:8000/docs
- Try different queries: Test edge cases and complex scenarios
- Upload your documents: Try PDFs, policies, resumes
- Check vector store: Inspect
./chroma_db/directory - Review logs: Monitor agent decisions and tool calls
Performance Tips β‘
Support π
You're all set! π Start making requests to your AI backend!