Repository navigation
Closed
Labels
Description
Problem / Goal
When processing large files, the RAG service frequently stalls at the cognee.cognify() step, which performs LLM-based knowledge graph extraction (entity/relationship extraction per chunk). This is the most expensive step in the ingestion pipeline.
However, no consumer actually uses knowledge graph search:
query_rag_context.tscalls/api/v1/searchwithout specifyingsearch_type→ defaults toSearchType.CHUNKSrag_search_tool.tscalls/api/v1/generate→ internally usesCHUNKSsearch
The graph database (FalkorDB) is being populated but never queried. Only vector similarity on text chunks is used.
Context
Current Pipeline (cognee.cognify() runs all 5 steps)
classify_documents- Document type identificationextract_chunks_from_documents- Text chunkingextract_graph_from_data- Knowledge graph extraction via LLM (bottleneck)summarize_text- Hierarchical summariesadd_data_points- Vector/node storage
Proposed Pipeline (skip steps 3 & 4)
Cognee 0.5.1 supports run_custom_pipeline() which allows composing only the needed tasks. Replace cognee.cognify() with a custom pipeline that only runs: classify → chunk → store.
Key Files
services/rag/app/services/cognee/service.py(lines 728-770) -cognee.cognify()call to replaceservices/platform/convex/agent_tools/rag/query_rag_context.ts- Consumer (CHUNKS only)services/platform/convex/agent_tools/rag/rag_search_tool.ts- Consumer (CHUNKS only)
Trade-offs
- Graph-based search types (GRAPH_COMPLETION, GRAPH_SUMMARY_COMPLETION, etc.) will not work until re-enabled
- FalkorDB infrastructure stays intact for potential future use
Acceptance Criteria
- Replace
cognee.cognify()withrun_custom_pipeline()using only classify + chunk + store tasks - Large file ingestion no longer stalls at knowledge graph extraction
- Documents are chunked and embedded correctly
- CHUNKS search continues to work via
cognee.search() -
/api/v1/generateendpoint continues to work - Remove
graph_extraction_prompt/custom_promptconfig usage (no longer needed) - Keep FalkorDB infrastructure intact for potential future re-enablement
- Add configuration flag (e.g.
ENABLE_GRAPH_EXTRACTION=false) to optionally re-enable full pipeline later
🤖 Generated with Claude Code
Activity
feat: create tale_shared package with config, db retry, utils
feat: create tale_knowledge package with vision, embedding, chunking,…
feat(db): add unified tale_knowledge database with dual schemas
feat(rag): add new RAG service internals replacing CogneeService
refactor(rag): replace cognee with new RAG service in routers and sta…
refactor(crawler): migrate to tale_knowledge database and shared pack…
chore: remove cognee, FalkorDB, graph-db service, update CI/CD and CLI
test(rag): add tests for new RAG search, indexing, and service modules
fix: resolve integration issues found during Docker testing
feat: create tale_shared package with config, db retry, utils
feat: create tale_knowledge package with vision, embedding, chunking,…
feat(db): add unified tale_knowledge database with dual schemas
feat(rag): add new RAG service internals replacing CogneeService
refactor(rag): replace cognee with new RAG service in routers and sta…
refactor(crawler): migrate to tale_knowledge database and shared pack…
chore: remove cognee, FalkorDB, graph-db service, update CI/CD and CLI
test(rag): add tests for new RAG search, indexing, and service modules
fix: resolve integration issues found during Docker testing