| title | Agents Knowledge Base | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| emoji | 🤖 | |||||||||
| colorFrom | blue | |||||||||
| colorTo | purple | |||||||||
| sdk | docker | |||||||||
| pinned | false | |||||||||
| tags |
|
AI-powered customer support agent with two tools: search a pre-indexed knowledge base and escalate to human support when needed. Built with Groq + ChromaDB + Streamlit.
- 🔍 Knowledge base search — semantic search over pre-indexed PDFs
- 🚨 Human escalation — automatic escalation with ticket creation
- 💬 Chat interface — conversation history with Streamlit
- 📋 Escalation dashboard — view pending tickets in the sidebar
- ⚡ Ultra-fast — powered by Groq inference
Customer question
│
▼
Escalation keywords detected?
YES → Create ticket → Human agent
NO → Search knowledge base
│
Found answer?
YES → Answer customer
NO → Create ticket → Human agent
Escalation triggers :
- Customer explicitly requests a human agent
- Keywords detected: urgent, complaint, frustrated...
- No relevant answer found in the knowledge base
| Component | Tool | Role |
|---|---|---|
| LLM | Groq (llama-3.3-70b-versatile) | Answer generation |
| Embeddings | HuggingFace (all-MiniLM-L6-v2) | Text vectorization |
| Vector Store | ChromaDB | Semantic search |
| UI | Streamlit | Chat interface |
- Python 3.11+
- A Groq API key (free)
git clone https://github.com/salmazenn/agents-knowledge-bas.git
cd agents-knowledge-baspython3 -m venv .venv-agents
source .venv-agents/bin/activatepip install -r requirements.txtcp env.example .envEdit .env:
# Required
GROQ_API_KEY=your_groq_api_key_here
# Optional
GROQ_MODEL=llama-3.3-70b-versatile
CHROMA_PERSIST_DIR=./data/chroma
DOCS_DIR=./docs
CHUNK_SIZE=1000
CHUNK_OVERLAP=100
TOP_K=3
ESCALATION_LOG=./data/escalations.jsoncp your-faq.pdf docs/python src/ingest.pystreamlit run src/app.pyOpen http://localhost:8501 🎉
| Variable | Default | Description |
|---|---|---|
GROQ_API_KEY |
— | Required. Your Groq API key |
GROQ_MODEL |
llama-3.3-70b-versatile |
Groq model |
CHROMA_PERSIST_DIR |
./data/chroma |
ChromaDB storage path |
DOCS_DIR |
./docs |
Folder with your PDFs |
CHUNK_SIZE |
1000 |
Chunk size in tokens |
CHUNK_OVERLAP |
100 |
Overlap between chunks |
TOP_K |
3 |
Number of chunks retrieved |
ESCALATION_LOG |
./data/escalations.json |
Escalation tickets log |
agents-knowledge-base/
├── src/
│ ├── ingest.py # Index PDFs into ChromaDB
│ ├── agent.py # Agent logic (search + escalation)
│ └── app.py # Streamlit chat interface
├── docs/ # Drop your PDFs here
├── data/
│ ├── chroma/ # ChromaDB (auto-generated)
│ └── escalations.json # Escalation tickets
├── .env # API keys (never commit!)
├── env.example # Environment template
├── requirements.txt
├── Dockerfile
└── README.md
- Email notifications for escalation tickets
- Admin dashboard to manage tickets
- Multi-language support
- Integration with CRM (Salesforce, HubSpot)
- Analytics dashboard
MIT — free to use, modify and distribute.