dokkaiv0.1.0
Get Started

How it works

From a repository on disk to a streamed, grounded answer — the ingestion, retrieval and generation path.

The pipeline at a glance
text
                      ┌──────────────────┐
                      │                 Ollama (host)               │
                      │   nomic-embed-text   ·   qwen2.5-coder      │
                      └──▲──────────────────────────▲────────┘
              embeddings     │                           │  generation
  repo ─► cgr ─► graph JSON ─► chunker ─► Weaviate ◄──┤
       (Memgraph)   (nodes+edges)  (source+edges)   (vectors)     │
                                              hybrid search +      │
                                              graph expansion     │
  user ─► FastAPI /chat ─ builds connected context ────────┘ ► SSE

Ingestion pipeline

Triggered by POST /instances/pipeline. Runs as a background job reporting stages cgr → chunk → describe → upsert → done.

  1. Graph extraction. code-graph-rag (cgr) spins up an ephemeral Memgraph and emits a JSON graph of the repo — 4k+ nodes, 8k+ relationships for a medium backend.
  2. Chunking. Each code entity (Class / Function / Method / Interface / Enum / Type) becomes one chunk containing a compact header, its graph relations and the actual source sliced from the file.
  3. Vectorization & storage. Chunks are written to Weaviate, which embeds them via Ollama. Each object gets a deterministic UUID from (project, qualified_name), so re-ingestion upserts in place.

Retrieval

  1. Seeds. Hybrid search (vector + BM25) finds the entry points.
  2. Graph expansion. A breadth-first walk over the stored qualified_name edges pulls in callers/callees/definitions, scored with per-hop decay and hub-node protection so a popular utility doesn't flood the context.
  3. Context assembly. Results are ranked and formatted with provenance (SEED vs hop 1 · calls ← X) so the model understands the structure.

Generation

The connected context is injected into an audience-specific prompt and streamed from the local Ollama model over Server-Sent Events. See POST /chat for the event framing.