https://github.com/manojmallick/codemind
Developer AI that never forgets your codebase โ SigMap-style structural index fused with three-tier persistent memory (hot/warm/cold) powered by Qwen
https://github.com/manojmallick/codemind
ai-agent codebase-intelligence developer-tools hackathon memory-systems persistent-memory qwen typescript
Last synced: 7 days ago
JSON representation
Developer AI that never forgets your codebase โ SigMap-style structural index fused with three-tier persistent memory (hot/warm/cold) powered by Qwen
- Host: GitHub
- URL: https://github.com/manojmallick/codemind
- Owner: manojmallick
- License: mit
- Created: 2026-07-20T18:14:54.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2026-07-20T19:24:39.000Z (10 days ago)
- Last Synced: 2026-07-20T20:18:39.221Z (10 days ago)
- Topics: ai-agent, codebase-intelligence, developer-tools, hackathon, memory-systems, persistent-memory, qwen, typescript
- Language: TypeScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeMind ๐ง
**The developer AI that never forgets your codebase โ structural code intelligence fused with persistent experiential memory.**
[](LICENSE)
[](tsconfig.json)
[](https://www.alibabacloud.com/en/solutions/generative-ai/qwen)
[](#)
Every AI coding assistant starts fresh. Every session you re-explain your project, your naming conventions, your preferences. *"We use snake_case." "Auth lives in src/auth." "Never use print โ use logger."* Repeated. Every. Session.
CodeMind fixes this by combining two complementary memories:
- **Structural memory** (SigMap-style index) โ *"here are the relevant files and signatures for your query"*
- **Experiential memory** (three-tier, persistent) โ *"last time, you preferred the JWT approach over sessions"*
Neither alone is enough. Together they answer like a senior developer who has actually worked on your project.
---
## Table of Contents
- [Architecture](#architecture)
- [The Three Memory Tiers](#the-three-memory-tiers)
- [Memory Lifecycle](#memory-lifecycle)
- [How a Query Flows](#how-a-query-flows)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Project Structure](#project-structure)
- [Honest Status](#honest-status)
- [License](#license)
---
## Architecture
```mermaid
flowchart TB
Q([๐ฌ Developer query]) --> S & M
subgraph "Context Assembly"
S["SigMap index
ranked file signatures
(structural)"]
M["Memory retrieval
relevance = confidence ร decay
+ overlap + hit count
(experiential)"]
end
S & M --> LLM["Qwen-Max
answer grounded in
code AND history"]
LLM --> A([โ
Answer with file + preference citations])
LLM --> E["Memory extraction
preferences ยท corrections
conventions ยท facts"]
subgraph "Three-Tier Memory (persistent JSON)"
H["๐ฅ HOT
last 10 items
current session"]
W["๐ก๏ธ WARM
recurring, decaying
queryable"]
C["๐ง COLD
permanent conventions
no decay"]
end
E --> W
W -- "consolidation (Qwen-Max):
PROMOTE_COLD / KEEP_WARM / DISCARD" --> C
```
## The Three Memory Tiers
| Tier | Holds | Retention |
|---|---|---|
| **HOT** | Last 10 interactions of the current session | Rolling window |
| **WARM** | Recurring preferences and observations | Time-decayed confidence; periodically consolidated |
| **COLD** | Confirmed conventions and never-forget rules | Permanent โ confidence 0.95, zero decay |
Each entry carries a category (`preference` ยท `correction` ยท `convention` ยท `fact`), a confidence score, a decay rate, a timestamp, and a hit counter.
## Memory Lifecycle
1. **Write (automatic)** โ after every answer, Qwen-Max extracts memory-worthy items from the exchange and stores them in WARM.
2. **Read (every query)** โ memories are ranked by `confidence ร time-decay (60%) + query overlap (30%) + hit count (10%)`; the top matches join the prompt.
3. **Consolidate** โ Qwen-Max reviews WARM entries and rules each one: promote to COLD (proved recurrent), keep in WARM (with a confidence bump), or discard (outdated). Explicit corrections beat old memories.
The intended trajectory: Session 1 answers like any assistant; by Session 10 it knows your conventions and cites your own files and past choices back to you.
## How a Query Flows
```
Session 1: "How should I handle errors in this service?"
โ generic best-practice answer, memories extracted
Session N: "How should I handle errors in this service?"
โ "You've been using GlobalExceptionHandler.java; your team
convention is ErrorResponse objects with HTTP status codes โ
follow the pattern in PaymentService.handleException()."
```
## Quick Start
**Prerequisites:** Node.js 18+, a [Qwen Cloud API key](https://www.alibabacloud.com/en/product/modelstudio).
```bash
git clone https://github.com/manojmallick/codemind.git
cd codemind
npm install
cp .env.example .env # add your QWEN_API_KEY
npm run dev # multi-session demo on a sample repo index
```
## Configuration
| Variable | Default | Purpose |
|---|---|---|
| `QWEN_API_KEY` | โ (required) | Qwen Cloud API key |
| `QWEN_BASE_URL` | `https://dashscope.aliyuncs.com/compatible-mode/v1` | OpenAI-compatible endpoint |
Memory persists to `codemind_memory.json` (constructor parameter).
## Project Structure
```
codemind/
โโโ src/
โ โโโ index.ts # CodeMind class โ context assembly, chat, extraction
โ โโโ memory.ts # three-tier memory, relevance scoring, SigMap store, consolidation
โ โโโ qwenClient.ts # Qwen Cloud client with robust JSON handling
โโโ README.md
```
## Honest Status
This is a working prototype built for the hackathon window. The SigMap store here is a lightweight lexical simulator of the full [SigMap](https://www.npmjs.com/package/sigmap) signature index; the demo transcript is generated live per run, and no cross-session accuracy numbers are claimed until measured. See the memory-relevance formula in [src/memory.ts](src/memory.ts) โ it is deliberately simple and inspectable.
## License
[MIT](LICENSE) ยฉ 2026 Manoj Mallick ยท Built for the Qwen Cloud Hackathon, Track 1 (MemoryAgent).