Basic Concepts
Understanding the core concepts of Functor will help you build more effective applications. This guide covers knowledge graphs, memory systems, vector databases, and agent integration.
Knowledge Graphs
Knowledge graphs are structured representations of information as entities and their relationships. In Functor, they serve as the foundation for intelligent data retrieval.
Components
Entities
The "nodes" representing concepts, people, places, or things.
{ id: 'ML_001', type: 'Concept', name: 'Machine Learning' }Relations
The "edges" connecting entities with semantic meaning.
{ from: 'ML_001', to: 'AI_001', type: 'IS_SUBSET_OF' }Attributes
Properties providing additional context about entities.
{ definition: '...', confidence: 0.95, source: 'doc_123' }Knowledge Graph Structure
Vector Databases
Vector databases store high-dimensional embeddings that capture semantic meaning. They enable similarity search and context-aware retrieval.
How Embeddings Work
Text → Embedding → Search
Semantic Search
Memory Systems
Functor implements three types of memory inspired by cognitive science:
1. Episodic Memory
Stores experiences and events
Records what happened, when, and in what context. Used for conversation history, user interactions, and temporal reasoning.
2. Semantic Memory
Stores facts and knowledge
General knowledge independent of personal experience. Used for factual information, definitions, and relationships.
3. Procedural Memory
Stores how-to knowledge
Skills and procedures for performing tasks. Used for workflows, strategies, and action sequences.
Data Ingestion Pipeline
Understanding the ingestion pipeline helps you optimize document processing:
Processing Stages
File or URL submitted to ingestion API
Content extracted from PDF, HTML, DOCX, etc.
Text split into semantic chunks (typically 500-1000 tokens)
NER identifies entities (people, places, concepts)
Relationships between entities identified
Vector embeddings created for semantic search
Data stored in Neo4j (graph), Qdrant (vectors), SQLite (metadata)
Query Processing
When you execute a query, multiple systems work together:
Query Flow
Intent classification and entity recognition
Choose appropriate retrieval strategy (knowledge graph, vector search, hybrid)
Search knowledge graph and vector database
Combine retrieved information with user context
Generate natural language response
Add source citations and validate answer quality
Agent Integration
Functor can be integrated into agent frameworks through the SDK:
LangChain Integration
Multi-Agent Systems
Best Practices
Knowledge Graph Design
- Organize by domain: Create separate KGs for different domains (medical, technical, etc.)
- Use consistent naming: Standardize entity and relation types
- Add rich metadata: Include confidence scores, sources, timestamps
- Monitor growth: Track entity and relation counts
Memory Management
- Use appropriate memory types: Episodic for events, semantic for facts, procedural for workflows
- Set retention policies: Configure TTLs for short-term memory
- Consolidate regularly: Archive old episodes to long-term memory
- Add context: Include user_id, session_id, timestamps
Query Optimization
- Be specific: More specific queries yield better results
- Use appropriate max_results: Don't retrieve more than needed
- Target specific KGs: Specify kg_names when possible
- Monitor performance: Track processing_time_ms
Next Steps
Advanced Querying
Learn about query parameters, pipeline selection, and optimization.
Memory Operations
Explore episodic, semantic, and procedural memory management.
Data Ingestion
Master document upload, processing, and knowledge graph building.
Agent Integration
Integrate with LangChain, CAMEL-AI, and other agent frameworks.