Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContextFlow.AI

An intelligent AI research assistant powered by LLMs, RAG, and LangGraph for document understanding, reasoning, and context-aware answers.

Python FastAPI LangChain LangGraph ChromaDB Streamlit

ContextFlow.AI Workflow

◈ Overview

ContextFlow AI is a production-inspired AI research assistant that combines:

  • Large Language Models (LLMs)
  • Retrieval-Augmented Generation (RAG)
  • Vector Databases
  • LangGraph workflows
  • Tool-assisted reasoning (AI Agent)
  • Conversation/session memory

The system allows users to upload documents, retrieve relevant information, and generate grounded answers instead of relying only on an LLM's internal knowledge.

◈ Problem

Traditional LLM chatbots have limitations:

  • No access to private documents
  • Hallucinated information
  • No semantic document search
  • Limited reasoning capabilities
  • No persistent conversation context

◈ Solution

ContextFlow AI addresses these challenges by integrating several modern AI techniques into a unified system.

The application:

  • Understands user intent using an LLM
  • Retrieves relevant information from uploaded documents using RAG
  • Stores semantic document embeddings in a vector database
  • Maintains conversational memory for contextual interactions
  • Uses AI Agents to plan and execute multi-step tasks (calculation, web search)
  • Produces grounded, explainable, and context-aware responses

◈ LangGraph Workflow

The assistant uses a conditional LangGraph workflow:

  1. User sends a question.
  2. Router LLM determines whether Retrieval-Augmented Generation (RAG) is required.
  3. If RAG is required:
    • Retrieve relevant documents from ChromaDB.
    • Store the retrieved context in the graph state.
  4. The chatbot LLM generates a response.
  5. If the LLM requests a tool:
    • Execute the appropriate tool.
    • Return the tool result to the chatbot.
    • Generate the final response.
  6. Return the answer to the user.

◈ ⚙️ Installation

1. Clone the repository

git clone https://github.com/<your-username>/ContextFlow-AI.git
cd ContextFlow-AI

2. Create a virtual environment

uv venv

Activate it.

Windows

.venv\Scripts\activate

Linux / macOS

source .venv/bin/activate

3. Install dependencies

uv sync

4. Configure environment variables

Create a .env file in the project root.

OPENAI_API_KEY=your_api_key_here
TAVILY_API_KEY=your_api_key_here

5. Run the backend

uv run uvicorn app.main:app --reload

6. Run the frontend

streamlit run .\frontend\app.py

Open:

http://localhost:8501/

◈ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

See the LICENSE file for more information.

About

An intelligent AI research assistant powered by LLMs, RAG, and LangGraph for document understanding, reasoning, and context-aware answers.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages