Coder DB - AI Memory Enhancement System

by angrysky56

8 351 downloads Not rated yet MIT

About

An intelligent code memory system that leverages vector embeddings, structured databases, and knowledge graphs to store, retrieve, and analyze code patterns with semantic search capabilities, quality metrics, and relationship modeling. Designed to enhance programming workflows th

Details

License
MIT

Explore

- Stores code patterns, solutions, and documentation with semantic search.
- Tracks algorithm versions with performance metrics and change logs.
- Represents relationships between coding concepts via a knowledge graph.
- Enables enhanced problem-solving, pattern learning, and project setup workflows.
- Includes security measures (access controls, backup, sanitization).
- Provides usage tracking and performance monitoring.

1. Store your first code memory:

   qdrant-store-memory(json.dumps({
"type": "code_pattern",
"name": "Python decorator pattern",
"code": "def my_decorator(func):\n def wrapper(args, kwargs):\n # Do something before\n result = func(args, kwargs)\n # Do something after\n return result\n return wrapper",
"explanation": "Decorators provide a way to modify functions without changing their code.",
"tags": ["python", "decorator", "metaprogramming"],
"complexity": "intermediate"
}))

2. Retrieve it later:

   qdrant-find-memories("python decorator pattern")

When starting a new project:

1. Template Selection:
- Choose from library of project templates
- Customize based on project requirements
- Select language, framework, and testing tools

2. Automated Setup:
- Generate project structure with proper directory layout
- Set up version control with appropriate .gitignore
- Configure linting and code quality tools
- Initialize testing framework

3. Best Practices Integration:
- Query memory system for relevant boilerplate code
- Retrieve best practices for the specific project type
- Use stored documentation templates for initial setup
- Configure CI/CD based on project requirements

This project uses Poetry for dependency management and packaging.

1. Install Poetry (if you haven't already):
Follow the instructions on the Poetry website.

2. Install Dependencies:
Navigate to the directory containing pyproject.toml (this should be the mcp_server directory if you created it as a self-contained Poetry project, or the root of this repository if mcp_server is a sub-package of a larger Poetry project) and run:

    poetry install --with dev # --with dev includes testing dependencies

This will create a virtual environment (if one doesn't exist for this project) and install all dependencies.

3. Environment Configuration (Optional but Recommended):
The application uses settings defined in mcp_server/core/config.py. You can override these by creating a .env file in the same directory where you run uvicorn (typically the root of the repository or mcp_server/ if running from there).
Example .env file content:


With development dependencies installed (poetry install --with dev):
From the root of the repository:
bash
poetry run pytest
``
This will discover and run tests located in the
mcp_server/tests/` directory.

A structured memory system for AI assistants to enhance coding capabilities using database integration utilizing Claude Desktop and MCP Servers.

Overview

This system leverages multiple database types to create a comprehensive memory system for coding assistance:

1. Qdrant Vector Database: For semantic search and retrieval of code patterns
2. SQLite Database: For structured algorithm storage and versioning
3. Knowledge Graph: For representing relationships between coding concepts

Database Usage Guide

Qdrant Memory Storage

For storing and retrieving code snippets, patterns, and solutions by semantic meaning.

What to store:
- Reusable code patterns with explanations
- Solutions to complex problems
- Best practices and design patterns
- Documentation fragments and explanations

Enhanced Metadata:
- Language and framework details
- Complexity level (simple, intermediate, advanced)
- Dependencies and requirements
- Quality metrics (cyclomatic complexity, documentation coverage)
- User feedback and ratings

Example Usage:
```python

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.