Skip to content

cecon/cappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Cappy ๐Ÿง 

Context Engine for AI Agents

Stop fighting with AI tools that don't understand your codebase. Cappy builds a living knowledge graph of your project so AI agents actually know where things are and how they connect.

VSCode Marketplace Downloads Rating Installs


The Problem

You're building with AI tools but:

  • ๐Ÿ”„ Constantly copy-pasting code into ChatGPT for context
  • ๐Ÿคท AI suggests changes in the wrong files
  • ๐Ÿ˜ค Copilot doesn't understand how your modules relate
  • โฐ Spend more time explaining your codebase than coding

Why? LLMs are great at code patterns but terrible at understanding YOUR specific project structure.


The Solution

Cappy creates two intelligent databases of your codebase:

  1. ๐Ÿ•ธ๏ธ Knowledge Graph - Maps entities and relationships
    (UserService โ†’ UserRepository โ†’ Database)

  2. ๐Ÿ” Vector Database - Semantic search across code and docs
    (Find "where we validate emails" instantly)

When you ask "add CPF validation like we do for email", Cappy knows:

  • โœ… Where email validation lives
  • โœ… Which files import it
  • โœ… The pattern you use
  • โœ… Where to put the new validation

Real-World Impact

Used internally to power autonomous development agents:

Without Cappy With Cappy
30% success rate 70% success rate
Generic suggestions Context-aware solutions
Wrong file locations Knows exact structure
Wastes expensive tokens Efficient, targeted context

How It Works

1. ๐Ÿ“‚ Scans your workspace
   โ†“
2. ๐Ÿงฉ Extracts entities (classes, functions, modules)
   โ†“
3. ๐Ÿ”— Maps relationships (imports, calls, dependencies)
   โ†“
4. ๐Ÿ’พ Builds Graph DB + Vector DB
   โ†“
5. ๐Ÿค– AI tools access rich context via MCP

Features

๐Ÿ—บ๏ธ Interactive Knowledge Graph

  • Visualize your codebase structure
  • See how components relate
  • Click to navigate code

๐Ÿ” Semantic Code Search

  • Natural language queries
  • Find by intent, not just keywords
  • Search across code + docs

๐Ÿค– AI Agent Integration

  • MCP (Model Context Protocol) tools
  • Enriched context for LLMs
  • Automatic todo list generation

๐Ÿ“š Smart Documentation

  • Auto-chunks markdown with overlap
  • Extracts entities from docs
  • Links docs to code

โšก Real-Time Updates

  • Watches file changes
  • Incremental graph updates
  • Always in sync

Installation

1. Install Extension

# From VSCode Marketplace
code --install-extension eduardocecon.cappy

Or search "Cappy" in VSCode Extensions

2. Configure API Key

// settings.json
{
  "cappy.openaiApiKey": "sk-..."
}

3. Initialize Workspace

  1. Open your project in VSCode
  2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Type "Cappy: Initialize Workspace"
  4. Cappy creates .cappy/ folder and adds .cappy/data/ to .gitignore
  5. Choose to start file processing or run "Cappy: Scan Workspace" later

๐Ÿ’ก Note: Cappy only activates in workspaces where you explicitly initialize it. This prevents automatic folder creation in all your projects.


Usage

Chat with Your Codebase

You: "Where do we validate user emails?"
Cappy: Found in src/validators/email.ts, used by UserService and AuthController

You: "Add CPF validation following the same pattern"
Cappy: [generates todo list with exact file locations and relationships]

View Knowledge Graph

Cmd+Shift+P โ†’ "Cappy: Show Graph"

Navigate your codebase visually - see imports, dependencies, call chains.

Semantic Search

Cmd+Shift+P โ†’ "Cappy: Search Codebase"

Find code by what it DOES, not what it's named.


Use Cases

๐Ÿš€ Onboarding

New dev? Ask Cappy "how does authentication work?" - get instant architecture overview with code links.

๐Ÿค– Autonomous Agents

Running agents like OpenHands? Give them Cappy's context - watch success rates jump from 30% to 70%.

๐Ÿ” Code Review

"What files will this change affect?" - Cappy shows the dependency graph.

๐Ÿ“– Documentation

Cappy keeps docs linked to code. Change a function? See which docs reference it.

๐Ÿงช Refactoring

"Where is this function called?" - instant answer with full context.


Configuration

{
  // Required
  "cappy.openaiApiKey": "sk-...",
  
  // Optional
  "cappy.model": "gpt-4o-mini",
  "cappy.chunkSize": 1000,
  "cappy.chunkOverlap": 200,
  "cappy.excludePatterns": ["node_modules", "dist", ".git"],
  "cappy.graphDepth": 3
}

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           VSCode Extension              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ File     โ”‚โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ Entity       โ”‚   โ”‚
โ”‚  โ”‚ Watcher  โ”‚      โ”‚ Extractor    โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                           โ”‚            โ”‚
โ”‚                           โ–ผ            โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚         โ”‚   Graph DB (Local)      โ”‚   โ”‚
โ”‚         โ”‚   - Entities            โ”‚   โ”‚
โ”‚         โ”‚   - Relationships       โ”‚   โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                           โ”‚            โ”‚
โ”‚                           โ–ผ            โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚         โ”‚  Vector DB (Local)      โ”‚   โ”‚
โ”‚         โ”‚   - Code embeddings     โ”‚   โ”‚
โ”‚         โ”‚   - Doc embeddings      โ”‚   โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                           โ”‚            โ”‚
โ”‚                           โ–ผ            โ”‚
โ”‚         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚         โ”‚   MCP Server            โ”‚   โ”‚
โ”‚         โ”‚   - Expose tools        โ”‚   โ”‚
โ”‚         โ”‚   - Serve context       โ”‚   โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
                    โ–ผ
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚  AI Agent / Chat   โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Design Decisions:

  • Local-first: All data stays on your machine
  • Incremental updates: Only processes changed files
  • Multi-DB: Graph for structure, Vector for semantics
  • MCP Standard: Works with any MCP-compatible AI tool

Roadmap

โœ… Done

  • Graph DB with entity extraction
  • Vector DB with semantic search
  • MCP server integration
  • File watcher with incremental updates
  • Chat interface with context

๐Ÿšง In Progress

  • Interactive graph visualization
  • Multi-language support (currently optimized for JS/TS)
  • Team sync (share graph across team)

๐Ÿ”ฎ Planned

  • Cloud-hosted graphs (optional)
  • Custom entity extractors
  • Integration with Jira/Linear
  • Analytics dashboard
  • Pre-built patterns library

FAQ

Q: Does my code leave my machine?
A: Only for LLM API calls (OpenAI). The databases are 100% local. You can use local LLMs if preferred.

Q: How big can my project be?
A: Tested on projects up to 500k LOC. Scan time scales linearly (~1 min per 50k LOC).

Q: Which languages are supported?
A: Currently optimized for JavaScript/TypeScript. Python, Go, Java support coming soon.

Q: Can I use this with Cursor/Copilot?
A: Yes! Cappy exposes MCP tools that any AI assistant can use.

Q: Is it free?
A: Extension is free. You pay only for your OpenAI API usage (~$0.01-0.10 per scan depending on project size).

Q: Can I run this on CI/CD?
A: Not yet, but planned. Would enable "graph as documentation" in your repo.


Enterprise / Agent Service

Using Cappy to power autonomous dev agents?

We offer a hosted agent service that uses Cappy's context engine to:

  • Pick up tasks from Jira/Linear
  • Develop, test, and open PRs
  • 70%+ success rate on CRUD/integration tasks

Interested? Email: [seu-email@domain.com] or [link to landing page]


Contributing

Contributions welcome! This is a passion project that solves a real problem.

Areas needing help:

  • Language parsers (Python, Java, Go, Rust)
  • Graph visualization improvements
  • Documentation
  • Test coverage

See CONTRIBUTING.md


Tech Stack

  • Extension: TypeScript + VSCode API
  • Graph DB: [your choice - Neo4j? Custom?]
  • Vector DB: [your choice - ChromaDB? LanceDB?]
  • LLM: OpenAI GPT-4o-mini (configurable)
  • MCP: Model Context Protocol for tool exposure

License

MIT - see LICENSE


Credits

Built by @cecon to stop copying code into ChatGPT 1000 times a day.

If Cappy saves you time, consider:

  • โญ Starring the repo
  • ๐Ÿ› Reporting bugs
  • ๐Ÿ’ก Suggesting features
  • ๐Ÿ”€ Contributing code

Stop explaining your codebase. Let Cappy do it.

Install Now | Documentation | Discord | Twitter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages