cognee/docker-compose.yml
Dmitrii Galkin e147fa5bde
feat: Add support for ChromaDB (#622)
<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->

# Add Support for ChromaDB

## Summary
This PR adds support for ChromaDB as a vector database option in the
Cognee application. ChromaDB is a modern, open-source embedding database
designed for AI applications.

## Changes
- Created a new ChromaDBAdapter implementation for vector database
operations
- Added comprehensive test suite for ChromaDB functionality
- Updated docker-compose.yml to include ChromaDB service
- Modified environment configuration to support ChromaDB settings
- Updated vector engine creation logic to support ChromaDB as an option

## Technical Details
- Implemented `ChromaDBAdapter.py` (347 lines) with full CRUD operations
for vector data
- Created test suite (`test_chromadb.py`) with 171 lines of test
coverage
- Updated vector engine creation process to dynamically select ChromaDB
when configured
- Modified settings router to accommodate new database option
- Updated environment template with ChromaDB configuration options

## Docker Changes
- Added ChromaDB service to docker-compose.yml with appropriate
configuration

This PR enhances Cognee's flexibility by providing an alternative vector
database option, allowing users to choose the most appropriate database
for their specific use case.



## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin

Tested with UI + tests.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Expanded vector database integration by adding support for Chromadb,
enabling enhanced data management and search functionalities.
- **Tests**
- Added automated tests to validate the Chromadb integration and related
operations.
- **Chores**
- Updated configuration guidance and dependency management to include
Chromadb.
  - Provided an optional container deployment template for Chromadb.
- Added a new entry to ignore the `.chromadb_data/` directory in version
control.
- Introduced a new GitHub Actions workflow for testing Chromadb
integration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: hajdul88 <52442977+hajdul88@users.noreply.github.com>
Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com>
2025-03-13 15:13:04 +01:00

105 lines
2.3 KiB
YAML

services:
cognee:
container_name: cognee
networks:
- cognee-network
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- /app/cognee-frontend/ # Ignore frontend code
environment:
- HOST=0.0.0.0
- ENVIRONMENT=local
- PYTHONPATH=.
ports:
- 8000:8000
# - 5678:5678 # Debugging
deploy:
resources:
limits:
cpus: "2.0"
memory: 8GB
frontend:
container_name: frontend
build:
context: ./cognee-frontend
dockerfile: Dockerfile
volumes:
- ./cognee-frontend/src:/app/src
- ./cognee-frontend/public:/app/public
ports:
- 3000:3000
# - 9229:9229 # Debugging
networks:
- cognee-network
neo4j:
image: neo4j:latest
container_name: neo4j
profiles:
- neo4j
ports:
- 7474:7474
- 7687:7687
environment:
- NEO4J_AUTH=neo4j/pleaseletmein
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
networks:
- cognee-network
falkordb:
image: falkordb/falkordb:edge
container_name: falkordb
profiles:
- falkordb
ports:
- 6379:6379
- 3001:3000
networks:
- cognee-network
chromadb:
image: chromadb/chroma:0.6.3
container_name: chromadb
profiles:
- chromadb
environment:
- IS_PERSISTENT=TRUE
- CHROMA_SERVER_AUTH_CREDENTIALS=${VECTOR_DB_KEY}
- CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.token.TokenConfigServerAuthCredentialsProvider
- CHROMA_SERVER_AUTH_TOKEN_TRANSPORT_HEADER=AUTHORIZATION
- CHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.token.TokenAuthServerProvider
volumes:
- .chromadb_data/:/chroma/chroma/
networks:
- cognee-network
ports:
- "3002:8000"
# UNCOMMENT IF USING POSTGRES
# postgres:
# image: pgvector/pgvector:pg17
# container_name: postgres
# environment:
# POSTGRES_USER: cognee
# POSTGRES_PASSWORD: cognee
# POSTGRES_DB: cognee_db
# volumes:
# - postgres_data:/var/lib/postgresql/data
# ports:
# - 5432:5432
# networks:
# - cognee-network
# UNCOMMENT THE VOLUES SECTION BELOW AS WELL TO USE POSTGRES
networks:
cognee-network:
name: cognee-network
volumes:
chromadb_data:
# UNCOMMENT IF USING POSTGRES
# postgres_data: