This project is a Proof of Concept (POC) for a terminal-based intelligent dialog system. It implements a Retrieval Augmented Generation (RAG) architecture to answer questions based on a local knowledge base.
The system is built in Python and leverages several key technologies:
- Orchestration: LangGraph is used to define the flow of logic, starting with a simple router that directs queries to a RAG chain.
- Language Model: The system uses a Google Gemini model for language understanding and generation.
- Vector Store: Qdrant serves as the vector database, running in a local Docker container.
- Data Ingestion: Scripts are provided to process and vectorize documents.
- Docker
- Python 3.9+
- uv - Fast Python package installer
a. Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | shb. Start Qdrant:
docker-compose up -dc. Configure API Key:
Create a .env file in the project root and add your Gemini API key.
GEMINI_API_KEY="your_gemini_api_key_here"
d. Create Virtual Environment and Install Dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txtMake sure your virtual environment is activated:
source .venv/bin/activate # On Windows: .venv\Scripts\activateThen run the application:
python -m src.main --crawlTo stop the application, type exit in the terminal.
This project follows a strict, plan-driven development process. All work must adhere to the following workflow.
Development is organized into phases (for new features) and fixes (for bug fixes), each defined in a .json file. The entire phase or fix should be treated as a single, atomic unit of work.
-
Plan:
- Before any work begins, a comprehensive plan must be documented in a
phases/phase-xxx.jsonorfixes/fix-xxx.jsonfile. - The plan will contain a list of smaller tasks or steps.
- This plan must be approved by the user.
- Before any work begins, a comprehensive plan must be documented in a
-
Implement & Verify (per task):
- Work through each task in the plan file sequentially.
- For each task:
- Update its
statustoin_progressin the.jsonfile. - Implement the necessary code.
- Test and verify that the changes work as expected and do not introduce regressions.
- For example:
python -m src.main --crawl - If bugs are found, they should be addressed before moving on.
- Once the task is complete, update its
statustocompleted.
- Update its
-
Commit (per phase/fix):
- Only after all tasks in the phase or fix are
completedcan the changes be committed. - Create a single new branch for the entire phase or fix (e.g.,
feature/phase-2orfix/db-connection). - Stage all relevant files (
git add .). - Commit the changes with a single, comprehensive message that summarizes the objective of the phase or fix. This message should be defined in the plan file.
- Only after all tasks in the phase or fix are
-
Update Plan on Completion:
- After the commit is successful, update the overall
statusof the phase or fix tocompleted. - Record the final timestamp and the full
commit_hashat the top level of the plan file.
- After the commit is successful, update the overall