Skip to content

About

GitHub has code. Slack/Discord has conversations. Notion has docs. But there's no AI agent connecting all three with context memory.

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

ContextKeeper - AI Memory Layer for Development Teams

Build Status Version License

ContextKeeper is a local-first AI agent that connects GitHub, Slack, and Documentation to provide contextual memory for your team. It answers "why" questions about code decisions by leveraging a Knowledge Graph and RAG (Retrieval-Augmented Generation).

πŸ“š New to ContextKeeper? Check out the complete documentation for detailed guides, or jump to Usage Examples to see it in action.

Table of Contents

✨ Features

  • πŸ”’ Robust Error Handling: Automatic retries, rate limit handling, and graceful error recovery.
  • πŸ’¬ Slack Integration: Collect team discussions and decisions from Slack channels.
  • πŸ•ΈοΈ Real Knowledge Graph: Automatically discover relationships between people, modules, and decisions.
  • πŸ—‚οΈ Multi-Repository Support: Separate ChromaDB instances for each repository (Path: ./chroma_db_{repository_name}).
  • πŸ€– Context-Aware Answers: Uses Hugging Face's Llama-3.2-3B-Instruct model and SentenceTransformer embeddings.

πŸ—οΈ Architecture

  • Orchestration: Kestra (Docker)
  • Backend API: Node.js + Express
  • AI Engine: Python (Hugging Face + ChromaDB)
  • Frontend: React + Vite
  • Database: MongoDB (Local or Atlas) & ChromaDB (Vector)

πŸ“– For detailed architecture information, see the Developer Guide and Architecture Overview.

This project implements specific features to qualify for the following Hackathon tracks:

Requirement: Use Kestra's built-in AI Agent to summarize data and make decisions.

  • Implementation: The kestra/flows/unified-contextkeeper-flow-v2.yml defines a comprehensive workflow that collects data from Slack, GitHub, and Notion.
  • AI-Driven Logic: It uses the Interface-based AI Agent pattern with the io.kestra.plugin.ai.completion.ChatCompletion task (using meta-llama/Llama-3.1-70B-Instruct) to:
    • Summarize team activity across all platforms.
    • Identify urgent items (bugs, blockers).
    • Make Decisions: It generates a structured decision report (ai_decisions.json) categorizing items as CRITICAL, HIGH, MEDIUM, or LOW, and recommends specific actions.

Requirement: Use Cline CLI to build powerful autonomous coding workflows.

  • Implementation: ContextKeeper acts as the "memory layer" for autonomous agents like Cline, providing them with the context needed to make informed changes.
  • Workflows: We utilize .github/workflows/cline-responder.yml (and other agentic workflows) to enable autonomous interactions where Cline can be triggered to respond to repository events, effectively acting as an autonomous maintainer.

Requirement: Best open-source engineering using CodeRabbit.

  • Implementation: We have fully integrated CodeRabbit for autonomous PR reviews and keeping the codebase clean.
  • Configuration: The .coderabbit.yaml file is customized to:
    • Enable high-level summaries and detailed code review.
    • Auto-reply to chat interactions (chat.auto_reply: true).
    • Enforce stringent checks (shellcheck, actionlint, eslint, prettier).
  • Workflow: The system is set up to provide immediate feedback on every Pull Request, ensuring high code quality and documentation standards.

οΏ½ Prerequisites

  • Docker & Docker Compose
  • Node.js (v16+)
  • Python (v3.9+)
  • MongoDB (Running locally or have an Atlas URI)

πŸš€ Installation

πŸ’‘ Need help? See the Troubleshooting Guide if you encounter any issues during installation.

1. Backend Setup

Configure and start the API server and AI engine.

πŸ“˜ For detailed backend documentation, including all API endpoints and Python scripts, see Backend README.

  1. Navigate to the backend directory:

    cd backend
  2. Install Node.js dependencies:

    npm install
  3. Install Python dependencies:

    pip install -r requirements.txt
  4. Environment Configuration:

    • Copy .env.example to .env:
      cp .env.example .env
    • Edit .env and add your credentials:
      • HUGGINGFACE_API_KEY: Your Hugging Face API key
      • GITHUB_TOKEN: Your GitHub Personal Access Token
      • GITHUB_REPO: Repository in format owner/repo
      • SLACK_TOKEN: Your Slack Bot Token (xoxb-...)
      • SLACK_CHANNELS: Comma-separated channel names
      • MONGODB_URI: MongoDB connection string
  5. Start the Server:

    npm start

    Server runs on http://localhost:3000.

2. Frontend Setup

Launch the user interface.

πŸ“˜ For detailed frontend documentation, including component architecture and development workflow, see Frontend README.

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start Development Server:

    npm run dev

    Access the UI at http://localhost:5173.

  4. Go to the Frontend URL (http://localhost:5173).

  5. Type a question like "Why did we choose Redis?".

  6. The system will query ChromaDB and Hugging Face to provide a context-aware answer.

  7. View the knowledge graph to see relationships between people, modules, and decisions.

3. Infrastructure Setup (Kestra)

πŸ“˜ For detailed Kestra workflow documentation, see Kestra README and Kestra Developer Guide.

  • Kestra instance (version 0.15.0+)
  • API tokens for:
    • Slack (Bot Token with appropriate scopes)
    • HuggingFace (for AI model access)
    • GitHub (optional, but recommended for higher rate limits)
    • Notion (optional)

Installation

  1. Clone or download this workflow YAML file

  2. Import into Kestra:

    # via Kestra UI
    # Navigate to Flows β†’ Create β†’ Import YAML
# my testing kestra server with docker

docker-compose --env-file .env up -d

#for windows - local kestra server with docker

docker run --pull=always --rm -it -p 8080:8080 --user=root ^
    -e HUGGINGFACE_API_KEY=hf_your_token_here ^
    -v "/var/run/docker.sock:/var/run/docker.sock" ^
    -v "C:/Temp:/tmp" kestra/kestra:latest server local
  1. Configure your tokens in the execution inputs

Configuration

Required Inputs

Input Description Example
slack_token Slack Bot Token xoxb-your-token
huggingface_token HuggingFace API Token hf_xxxxx
github_repo Repository to monitor owner/repo
slack_channels Channels to monitor general,dev-team

Optional Inputs

Input Description Default
github_token GitHub PAT (increases rate limits) None
notion_token Notion Integration Token None
hours Time period for data collection 24
user_query Custom analysis query Auto-generated

πŸ“– Usage

πŸ“š For comprehensive usage examples and tutorials, see Usage Examples.

Collecting Data

Collect from GitHub:

curl -X POST http://localhost:3000/api/collect/github

Collect from Slack:

curl -X POST http://localhost:3000/api/collect/slack

For Specific Repository:

curl -X POST http://localhost:3000/api/collect/github \
  -H "Content-Type: application/json" \
  -d '{"repository": "owner/repo"}'

πŸ“‘ API Endpoints

πŸ“– For complete API documentation, including all endpoints, request/response formats, and examples, see API Reference and Backend README.

Query

POST /api/query
Body: { "question": "Why did we choose Redis?", "repository": "owner/repo" }

Knowledge Graph

GET /api/knowledge-graph?repository=owner/repo

System Status

GET /api/status?repository=owner/repo

🀝 Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details on how to get started, our code of conduct, and the process for submitting pull requests.

πŸ› οΈ Developer Resources:

πŸ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

πŸ’¬ Support

For support, please refer to SUPPORT.md or open an issue in the issue tracker.

πŸ†˜ Need Help?

πŸ‘€ Author

Yadnyesh Kolte

πŸ™ Acknowledgments

  • Hugging Face for the amazing models.
  • The Open Source community for the tools and libraries used in this project.

About

GitHub has code. Slack/Discord has conversations. Notion has docs. But there's no AI agent connecting all three with context memory.

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages