FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
Reecall AiGetting Started
Neural Repository Memory Engine Specs
Docsreecall-aiGetting StartedNeural Repository Memory Engine Specs
GitHub Live Sync

Neural Repository Memory Engine Specs

Live technical documentation fetched from GitHub repository omghante/reecall.ai/README.md

ReeCall.ai

Neural Repository Memory Engine
Learn file relationships. Retrieve engineering context. No language generation.

Quickstart · Architecture · Training · Evaluation · Model ↗

Overview

ReeCall.ai is a lightweight Graph Neural Network (GNN) system that learns semantic relationships between files in TypeScript/JavaScript repositories and retrieves relevant engineering context as structured output.
ReeCall.ai is NOT a code generator, chatbot, or autocomplete tool.
ReeCall.ai IS a neural memory engine — it builds a graph of your repository, trains 32-dimensional file embeddings via co-import prediction, and retrieves contextually relevant files using cosine similarity.

Key Properties

PropertyDetail
ArchitectureMLP encoder + 1-hop sparse neighbor aggregation + contrastive projection
Parameters~50K (CPU-friendly, trains in seconds)
Embedding Dim32 (L2-normalized for cosine similarity)
Training SignalCo-import prediction with contrastive loss
OutputStructured JSON — no language generation

Quickstart

Prerequisites

  • Python 3.10+
  • pip

Installation

bash
git clone https://github.com/om-ghante/reecall.ai.git
cd reecall.ai
pip install -r requirements.txt

Train on a Live Repository

bash
# Scan → Parse → Graph → Features → Train → Save
python train.py /path/to/your/ts-project --epochs 50

Train from Dataset

bash
# Train directly from CSV dataset
python train_dataset.py /path/to/dataset/ --epochs 50

Query the Memory

bash
# Retrieve relevant files for a natural language query
python infer.py /path/to/your/ts-project "authentication flow"

# JSON output
python infer.py /path/to/your/ts-project "payment processing" --json-output

Evaluate Embeddings

bash
python eval_model.py /path/to/dataset/

CLI Interface

bash
# Scan a repository
python -m cli.main scan /path/to/your/ts-project

# Build the repository graph
python -m cli.main graph /path/to/your/ts-project

# View feature clusters
python -m cli.main features /path/to/your/ts-project

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        ReeCall.ai Pipeline                         │
│                                                                     │
│  Repository ──► Parser ──► Graph Builder ──► Feature Grouper        │
│                                                    │                │
│                                                    ▼                │
│  Structured   ◄── Context  ◄── Neural    ◄── Embedding             │
│  Memory Output    Builder      Retrieval     Generator              │
└─────────────────────────────────────────────────────────────────────┘

Model Architecture

Input (128-dim feature vector)
    │
    ▼
┌──────────────────────────────┐
│  MLP Encoder                 │
│  Linear(128→64) → ReLU      │
│  Dropout(0.1)                │
│  Linear(64→64)  → ReLU      │
└──────────────┬───────────────┘
               │
       ┌───────┴───────┐
       │               │
       ▼               ▼
   Self Features   Sparse Neighbor
                   Aggregation (1-hop)
                   torch.sparse.mm
       │               │
       └───────┬───────┘
               │
               ▼
┌──────────────────────────────┐
│  Projection Head             │
│  Linear(128→64) → ReLU      │
│  Linear(64→32)               │
│  L2 Normalize                │
└──────────────────────────────┘
               │
               ▼
       32-dim Embedding

Module Reference

ModulePathResponsibility
Parser
parser/
Scan files, extract imports and symbols (regex-based)
Graph
graph/
Build file-level adjacency list with typed edges
Features
features/
Cluster files into logical feature groups (heuristic)
Model
model/
ReeCall — MLP + sparse graph aggregation → 32-dim embeddings
| Dataset |
dataset/
| Generate training pairs from co-import relationships | | Inference |
inference/
| Encode queries, retrieve top-K files, re-rank results | | Watcher |
watcher/
| Track file changes for incremental re-embedding | | Memory |
memory/
| Format structured JSON output (no language generation) | | CLI |
cli/
| Command-line interface for scan, graph, features |

Training

Training Signal: Co-Import Prediction

If
login.ts
imports
jwt.ts
, their embeddings should be close in vector space.
Pair TypeExampleLabel
Positive
(login.ts, jwt.ts)
— import relationship
1
Negative
(login.ts, stripe.ts)
— no relationship
0
Loss function: Contrastive loss with margin = 0.5

Feature Vector (128-dim)

DimensionsFeature
[0:4]
Structural scalars (depth, LOC, function count, import count)
[4:8]
Language one-hot (TypeScript, JavaScript)
[8:24]
File role one-hot (controller, service, model, util, etc.)
[24:28]
Neighbor density
[28:60]
Folder hash features
[60:92]
Function name hash features
[92:128]
Reserved (zero-padded)

Hyperparameters

ParameterDefaultFlag
Epochs50
--epochs
Learning Rate0.001
--lr
Embedding Dim32
--emb-dim
Margin0.5
Negative Ratio3:1
--neg-ratio
Weight Decay1e-4
Seed42
--seed

Evaluation

The evaluation suite (
eval_model.py
) measures embedding quality using two protocols:

Anchor-Based Retrieval

Pick the highest-relevance file as an anchor, retrieve nearest neighbors, measure against ground-truth relevant files.
MetricDescription
Precision@KFraction of retrieved files that are relevant
Recall@KFraction of relevant files that are retrieved
NDCG@KNormalized Discounted Cumulative Gain
MRRMean Reciprocal Rank
Hit@KWhether any relevant file appears in top-K

Link Prediction

For each import edge
(A → B)
, rank B among all files by cosine similarity to A.
MetricDescription
Mean RankAverage rank of the true import target
Hits@10 / @50Fraction of edges where target appears in top-10/50
MRRMean Reciprocal Rank over all edges

Output Format

ReeCall.ai returns structured JSON — no natural language, no hallucination.
json
{
  "query": "login flow",
  "feature": "auth",
  "files": [
    "src/auth/login.ts",
    "src/auth/register.ts",
    "src/utils/jwt.ts"
  ],
  "dependencies": ["src/db/redis.ts"],
  "related_features": ["middleware"]
}

Pre-trained Model

The trained ReeCall model checkpoint is available on HuggingFace:
python
import torch
from reecall_ai import ReeCall

model = ReeCall(input_dim=128, hidden_dim=64, embed_dim=32)
model.load_state_dict(torch.load("model.pt", weights_only=True))
model.eval()

Project Structure

reecall.ai/
├── cli/                    # Command-line interface
│   ├── main.py
│   └── commands.py
├── configs/
│   └── default.ini         # Default hyperparameters
├── dataset/                # Dataset generation & training pairs
├── features/               # Feature clustering & heuristics
├── graph/                  # Graph construction & storage
├── inference/              # Query retrieval & re-ranking
├── memory/                 # Context building & output formatting
├── model/                  # ReeCall model, embeddings, trainer

├── parser/                 # Repository scanner, import/symbol parsing
├── tests/                  # Unit tests
├── watcher/                # File change tracking
├── train.py                # Live repository training entry point
├── train_dataset.py        # CSV dataset training entry point
├── infer.py                # Inference entry point
├── eval_model.py           # Evaluation suite
├── requirements.txt        # Python dependencies
└── LICENSE                 # MIT License

V1 Scope

FeatureStatus
Repository parsing (TS/JS)
Import graph construction
Feature clustering
Neural embeddings (GNN)
Sparse matrix training
Semantic retrieval
Structured JSON output
File watcher (incremental)
Evaluation suite
HuggingFace model hosting
Multi-language support❌ (future)
LLM integration❌ (future)
Natural language generation❌ (by design)

Testing

bash
pytest tests/ -v

Tech Stack

ComponentTechnology
ML FrameworkPyTorch
Graph OperationsNetworkX + torch.sparse
CLIClick + Rich
Serializationorjson
File WatchingWatchdog
Testingpytest

License

This project is licensed under the MIT License.

Author

Om Ghante@om-ghante