How yugeshkaran/assistant_knowledge_hub works
BytesBase Assistant is a Flask RAG service for community posts. Authorized clients submit posts for embedding and indexing, or ask questions that are checked, embedded, matched against category-filtered and current-post content, then sent with a system prompt to an LLM for a schema-shaped answer. The README also describes suggestions and optional video results. The shown implementation uses Pinecone inference for embeddings; the README’s OpenAI embedding description differs. The graph follows shown calls and documented product behavior; unsampled capabilities and external-service boundaries are represented only where evidence supports them.
Main entry points: retrieval.py Search and fetch · app.py Flask API · ingestion.py Post ingest/delete · embedder.py Embedding generation
Components 16
API and safeguards
- Flask API
app.py - JWT guard
middleware/auth_token.py - Injection filter
utility/prompt_injection_filtering.py
Post ingestion
- Post ingest/delete
ingestion.py - Post text and metadata
ingestion.py - Embedding generation
embedder.py - Pinecone index
pinecone_client.py
Retrieval and answers
- Search and fetch
retrieval.py - Context assembly
retrieval.py - System prompt
utility/prompts/system.py - Groq language model
- Answer schema
utility/schema.py
Shared configuration
- Runtime configuration
utility/config.py
Other components
- Community client
- Pinecone service
- JSON answer
Connections 22
- Community client → Flask API: sends requests
app.py - Flask API → JWT guard: guards routes
app.py - Flask API → Injection filter: checks query
app.py - Flask API → Post ingest/delete: upserts or deletes
app.py - Post ingest/delete → Post text and metadata: builds text and metadata
ingestion.py - Post ingest/delete → Embedding generation: requests embedding
ingestion.py - Post ingest/delete → Pinecone index: upserts or deletes
ingestion.py - Embedding generation → Pinecone service: requests embedding
embedder.py - Pinecone index → Pinecone service: connects to index
pinecone_client.py - Flask API → Search and fetch: calls ask_ai
app.py - Search and fetch → Embedding generation: embeds query
retrieval.py - Search and fetch → Pinecone index: queries and fetches
retrieval.py - Search and fetch → Context assembly: assembles retrieved posts
retrieval.py - Flask API → System prompt: passes system prompt
app.py - Search and fetch → System prompt: includes prompt in chain
retrieval.py - Search and fetch → Groq language model: invokes model chain
retrieval.py - Search and fetch → Answer schema: parses structured output
retrieval.py - Search and fetch → JSON answer: returns parsed answer
retrieval.py - Flask API → JSON answer: returns HTTP JSON
app.py - Embedding generation → Runtime configuration: reads API key
embedder.py - Pinecone index → Runtime configuration: reads index settings
pinecone_client.py - Search and fetch → Runtime configuration: reads model settings
retrieval.py