Update README.md
Browse files
README.md
CHANGED
|
@@ -1,166 +1,3 @@
|
|
| 1 |
-
<<<<<<< HEAD
|
| 2 |
-
# 🚀 CodeSight AI — Intelligent Codebase Understanding Agent
|
| 3 |
-
|
| 4 |
-
`🚀 CodeSight AI` is a "ChatGPT for repositories" that indexes a software repository and answers developer questions with grounded source citations, code references, and architecture-aware reasoning.
|
| 5 |
-
|
| 6 |
-
---
|
| 7 |
-
|
| 8 |
-
## Highlights
|
| 9 |
-
|
| 10 |
-
- **Indexed code search**: AST- and tree-sitter-based chunking for Python, JS/TS, Java and Go.
|
| 11 |
-
- **Hybrid retrieval**: BM25 + vector search + dependency-graph boosts for precise, context-rich answers.
|
| 12 |
-
- **Pluggable LLMs & Embeddings**: Gemini for answer generation and Hugging Face / SentenceTransformers for embeddings.
|
| 13 |
-
- **Backend + Frontend**: FastAPI backend with Streamlit developer UI.
|
| 14 |
-
- **Vector DB + Graph store**: Qdrant for vectors and NetworkX/Neo4j for dependency graphs.
|
| 15 |
-
|
| 16 |
-
---
|
| 17 |
-
|
| 18 |
-
## Quickstart
|
| 19 |
-
|
| 20 |
-
1. Create a Python virtual environment and activate it (recommended).
|
| 21 |
-
|
| 22 |
-
```bash
|
| 23 |
-
python -m venv .venv
|
| 24 |
-
.\.venv\Scripts\activate # Windows
|
| 25 |
-
source .venv/bin/activate # macOS / Linux
|
| 26 |
-
```
|
| 27 |
-
|
| 28 |
-
2. Install dependencies and run services:
|
| 29 |
-
|
| 30 |
-
```bash
|
| 31 |
-
python -m pip install --upgrade pip setuptools wheel
|
| 32 |
-
pip install -r requirements.txt
|
| 33 |
-
uvicorn backend.main:app --reload
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
In another terminal run the frontend:
|
| 37 |
-
|
| 38 |
-
```bash
|
| 39 |
-
streamlit run frontend/app.py
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
Open:
|
| 43 |
-
|
| 44 |
-
- Backend API docs: http://localhost:8000/docs
|
| 45 |
-
- Frontend UI: http://localhost:8501
|
| 46 |
-
|
| 47 |
-
---
|
| 48 |
-
|
| 49 |
-
## Architecture
|
| 50 |
-
|
| 51 |
-
The system is organized into a small number of collaborating subsystems: Ingestion, Indexing & Embeddings, Retrieval & Reranking, Agents & Workflows, Backend API, Frontend UI, and Storage (Qdrant, Neo4j/NetworkX, relational DB). The diagram below shows the high-level flow.
|
| 52 |
-
|
| 53 |
-
```mermaid
|
| 54 |
-
flowchart LR
|
| 55 |
-
subgraph External
|
| 56 |
-
GH[GitHub / ZIP Upload]
|
| 57 |
-
HF[Hugging Face]:::api
|
| 58 |
-
Gemini[Gemini API]:::api
|
| 59 |
-
end
|
| 60 |
-
|
| 61 |
-
subgraph Ingestion
|
| 62 |
-
Loader[Repository Loader]
|
| 63 |
-
Parser[Parser & Chunker]\n(tree-sitter / AST)
|
| 64 |
-
end
|
| 65 |
-
|
| 66 |
-
subgraph Indexing
|
| 67 |
-
Embedder[Embedder (SentenceTransformers / HF)]
|
| 68 |
-
VectorStore[Qdrant]
|
| 69 |
-
GraphStore[Dependency Graph (NetworkX / Neo4j)]
|
| 70 |
-
end
|
| 71 |
-
|
| 72 |
-
subgraph Backend
|
| 73 |
-
API[FastAPI]
|
| 74 |
-
Agents[Agents & Workflows]\n(Planner / Retriever / Answer / Reflection)
|
| 75 |
-
Retrieval[Hybrid Retriever]\n(BM25 + Vector + Graph Boosts)
|
| 76 |
-
end
|
| 77 |
-
|
| 78 |
-
subgraph Frontend
|
| 79 |
-
UI[Streamlit Developer UI]
|
| 80 |
-
end
|
| 81 |
-
|
| 82 |
-
GH --> Loader --> Parser --> Embedder --> VectorStore
|
| 83 |
-
Parser --> GraphStore
|
| 84 |
-
Embedder --> HF
|
| 85 |
-
API --> Agents --> Retrieval --> VectorStore
|
| 86 |
-
Agents --> Gemini
|
| 87 |
-
UI --> API
|
| 88 |
-
API --> VectorStore
|
| 89 |
-
API --> GraphStore
|
| 90 |
-
|
| 91 |
-
classDef api fill:#f9f,stroke:#333,stroke-width:1px
|
| 92 |
-
```
|
| 93 |
-
|
| 94 |
-
---
|
| 95 |
-
|
| 96 |
-
## Component Details
|
| 97 |
-
|
| 98 |
-
- **Ingestion**: `ingestion/` contains loaders for GitHub repos and ZIP uploads. Chunking is language-aware (see `chunking/`).
|
| 99 |
-
- **Embeddings**: `embeddings/` wraps SentenceTransformers or direct Hugging Face calls; embeddings are stored in Qdrant.
|
| 100 |
-
- **Retrieval**: `retrieval/` composes BM25, vector search, and optional reranking to produce grounded context for agents.
|
| 101 |
-
- **Agents**: `backend/agents/` implements the planning, retrieval, answering, and reflection workflows that orchestrate the flow from user query to final answer.
|
| 102 |
-
- **API**: `backend/api/routes/` exposes endpoints for uploading repos, running queries, and health checks.
|
| 103 |
-
- **Frontend**: `frontend/` is a Streamlit app for interactive exploration and running queries against the indexed codebase.
|
| 104 |
-
|
| 105 |
-
---
|
| 106 |
-
|
| 107 |
-
## Environment Variables
|
| 108 |
-
|
| 109 |
-
Create a `.env` in the project root with at least these values (examples in `.env`):
|
| 110 |
-
|
| 111 |
-
```
|
| 112 |
-
HF_API_KEY="your_huggingface_token"
|
| 113 |
-
GEMINI_API_KEY="your_gemini_key"
|
| 114 |
-
USE_QDRANT=true
|
| 115 |
-
QDRANT_URL="https://your-qdrant-cloud-cluster-url"
|
| 116 |
-
QDRANT_API_KEY="your_qdrant_cloud_api_key"
|
| 117 |
-
QDRANT_COLLECTION="repo_vectors"
|
| 118 |
-
```
|
| 119 |
-
|
| 120 |
-
See the example `.env` in the repository for more settings (timeouts, batch sizes, Neo4j config).
|
| 121 |
-
|
| 122 |
-
---
|
| 123 |
-
|
| 124 |
-
## Running Locally (recommended)
|
| 125 |
-
|
| 126 |
-
- Use a recent Python 3.9+ interpreter.
|
| 127 |
-
- Ensure `QDRANT_URL` and `QDRANT_API_KEY` are set if `USE_QDRANT=true`.
|
| 128 |
-
|
| 129 |
-
Minimal commands:
|
| 130 |
-
|
| 131 |
-
```bash
|
| 132 |
-
pip install -r requirements.txt
|
| 133 |
-
uvicorn backend.main:app --reload
|
| 134 |
-
streamlit run frontend/app.py
|
| 135 |
-
```
|
| 136 |
-
|
| 137 |
-
---
|
| 138 |
-
|
| 139 |
-
## Troubleshooting
|
| 140 |
-
|
| 141 |
-
- If `sentence-transformers` fails to install, check `requirements.txt` for a pinned version.
|
| 142 |
-
- CI environment must use a compatible Python version (3.9+ recommended).
|
| 143 |
-
- For Qdrant connection issues, verify `QDRANT_URL` and `QDRANT_API_KEY` and network access.
|
| 144 |
-
|
| 145 |
-
---
|
| 146 |
-
|
| 147 |
-
## Contributing
|
| 148 |
-
|
| 149 |
-
1. Fork the repo and create a feature branch.
|
| 150 |
-
2. Run tests and linters locally before opening a PR.
|
| 151 |
-
3. Keep changes focused and add tests for new behaviors.
|
| 152 |
-
|
| 153 |
-
---
|
| 154 |
-
|
| 155 |
-
## License
|
| 156 |
-
|
| 157 |
-
This project is available under the MIT License. See [LICENSE](LICENSE) for details.
|
| 158 |
-
|
| 159 |
-
---
|
| 160 |
-
|
| 161 |
-
If you'd like changes to the diagram or a simplified view for presentations, tell me which components to emphasize and I'll update it.
|
| 162 |
-
=======
|
| 163 |
-
|
| 164 |
---
|
| 165 |
title: CodeSight AI
|
| 166 |
emoji: 🤖
|
|
@@ -169,4 +6,7 @@ colorTo: purple
|
|
| 169 |
sdk: docker
|
| 170 |
pinned: false
|
| 171 |
---
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: CodeSight AI
|
| 3 |
emoji: 🤖
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
+
|
| 10 |
+
# CodeSight AI
|
| 11 |
+
|
| 12 |
+
CodeSight AI is an intelligent codebase understanding agent that enables repository-level reasoning using Graph RAG, Hybrid Retrieval, LangGraph workflows, and LLM-based code understanding.
|