Earlier we utilized "Context Stuffing" to create the Digital You. This project evolves that concept into a Retrieval Augmented Generation (RAG) system for better scalability and efficiency.
- Ingestion: Reads documents from
/data. - Chunking: Splits text into manageable segments.
- Embedding: Converts text into numerical vectors.
- Retrieval: Fetches only relevant segments to answer user queries.
- Sync Environment:
uv syncin the root directory. - Data: Place .txt, .md, or .pdf files in the
/datadirectory. - Tasks: Complete the TODOs in
app.pyto build the RAG pipeline.
- Data Infrastructure: Build a vector store in
chroma_db/using your bio data. - Contextualization: Teach the AI how to re-write questions based on history so it never "forgets" the subject of conversation.
- Persona Engineering: You must write your own
qa_prompt. This is where you define your "Digital Twin" identity and force the AI to only use the retrieved context.
- Use
SemanticChunkerfor smarter context splitting. - Customize the Gradio UI using
gr.Blocks.