A real-time code intelligence system powered by Pathway and LangGraph, providing live codebase awareness with agentic reasoning capabilities.
CodeFlux is an intelligent developer assistant that combines Pathway's live data processing with LangGraph's agentic framework to provide real-time code intelligence. The system watches your codebase, maintains a live index, and answers questions about your code with confidence scoring and multi-step reasoning.
- π₯ Live Code Indexing: Real-time monitoring of code changes using Pathway
- π§ Agentic Reasoning: Multi-step reasoning powered by LangGraph
- π― Confidence Scoring: Every answer comes with confidence levels and reasoning
- π Change Intelligence: Track what changed, detect breaking changes, and analyze impact
- π¬ Interactive UI: Modern React-based frontend for seamless interaction
- π Context-Aware Retrieval: Smart context building from live codebase state
- π€ Gemini Integration: Powered by Google's Gemini 2.5 Flash model
The project consists of two main components:
backend/
βββ main.py # π FastAPI entry point
βββ pathway_engine/ # π₯ CORE LIVE ENGINE (Pathway)
β βββ ingestion/ # Code and GitHub repo watching
β βββ indexing/ # Live incremental indexing
β βββ query/ # Context retrieval and building
β βββ state/ # Version tracking
βββ agent/ # π§ AGENTIC REASONING
β βββ agent.py # LangGraph-based agent
β βββ planner.py # Multi-step reasoning
β βββ tools.py # Agent tools (diff, search, etc.)
β βββ confidence.py # Confidence assessment
βββ llm/ # π€ LLM CLIENT
βββ gemini_client.py # Gemini API wrapper
frontend/
βββ src/
β βββ components/ # Reusable UI components
β βββ pages/
β β βββ Dashboard.tsx # Main dashboard
β β βββ AskTheAgentPage.tsx # Query interface
β β βββ ChangeIntelligence.tsx
β β βββ ReasoningConfidence.tsx
β βββ App.tsx # Main app component
βββ package.json
- Python 3.8+ (for backend)
- Node.js 18+ and npm (for frontend)
- Google API Key (for Gemini)
- Git (for version control)
git clone https://github.com/ThelastC0debenders/Pathway-Hack.git
cd Pathway-Hackcd backend
# Install Python dependencies (recommended: use virtual environment)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install required packages
pip install fastapi uvicorn pathway-io langgraph langchain-core google-generativeai python-dotenv
# Create .env file
cat > .env << EOL
GOOGLE_API_KEY=your_gemini_api_key_here
PORT=8003
EOLcd ../frontend
# Install dependencies
npm install
# Start development server
npm run devTerminal 1 - Backend:
cd backend
python main.py
# Backend will start on http://localhost:8003Terminal 2 - Frontend:
cd frontend
npm run dev
# Frontend will start on http://localhost:5173Create a .env file in the backend directory:
# Required
GOOGLE_API_KEY=your_gemini_api_key_here
# Optional
PORT=8003Configure the watched repository/folder in backend/pathway_engine/config.py:
WATCH_FOLDER = "./watched_folder"
GITHUB_REPO_URL = "https://github.com/ThelastC0debenders/Pathway-Hack.git"
GITHUB_BRANCH = "main"-
Access the UI: Open your browser to
http://localhost:5173 -
Navigate to "Ask the Agent": Use the sidebar to access different features
-
Ask Questions: Type questions about your codebase:
- "How is file loading handled?"
- "What are the main components?"
- "Explain the agent architecture"
-
View Responses: Get detailed answers with:
- Explanation
- Relevant code snippets
- Confidence score and level
- Reasoning strategy used
- Source file references
Ask questions to the agent.
Request:
{
"query": "How is the file loading handled?"
}Response:
{
"explanation": "Detailed explanation...",
"code": "Relevant code snippets...",
"instruction": "How to use...",
"confidence": 0.85,
"confidence_level": "HIGH",
"strategy": "Direct retrieval",
"sources": [
{
"file": "path/to/file.py",
"lines": "10-25",
"text": "Code content..."
}
],
"trace": ["step1", "step2", "..."]
}cd backend
python test_agent.pyThe test runner provides an interactive prompt to test the agent:
β Ask a question (or type 'exit'): How does the agent work?
cd frontend
npm run build # Build for production
npm run lint # Run ESLint- FastAPI: Modern Python web framework
- Pathway: Real-time data processing and live indexing
- LangGraph: Agentic workflow framework
- LangChain: LLM integration utilities
- Google Gemini: AI model for code understanding
- React 19: UI framework
- TypeScript: Type-safe JavaScript
- Vite: Fast build tool and dev server
- React Router: Client-side routing
- Lucide React: Icon library
- React Markdown: Markdown rendering with syntax highlighting
Pathway-Hack/
βββ backend/ # Python backend
β βββ agent/ # Agentic reasoning system
β βββ llm/ # LLM client wrapper
β βββ pathway_engine/ # Pathway-based live indexing
β βββ main.py # FastAPI server
β βββ test_agent.py # Agent testing
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Application pages
β β βββ App.tsx # Main app
β βββ package.json
βββ README.md # This file
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is part of a hackathon submission. Please check with the team for licensing details.
ThelastC0debenders - Pathway Hackathon Participants
- Pathway for the amazing live data processing framework
- LangChain/LangGraph for the agentic framework
- Google for the Gemini API
- FastAPI and React communities
Built with β€οΈ for the Pathway Hackathon