Context
Graphiti extracts entities and relationships from text using LLM-powered pipelines. By default, it uses generic entity types (Preference, Requirement, Procedure, Location, Event, Organization, Document, Topic, Object). For coding sessions, we need custom entity types that better capture the domain-specific knowledge we want to remember.
This ensures that the knowledge graph is structured in a way that makes retrieval useful for future coding sessions.
Goal
Define and configure custom Pydantic entity types in Graphiti that are optimized for coding session knowledge extraction.
Requirements
Entity Types to Define
| Entity Type |
Description |
Example |
Project |
A software project or repository |
"pk-opencode-webui", "graphiti" |
Framework |
A framework or major library |
"SolidJS", "Express", "Tailwind CSS" |
Library |
A package or dependency |
"zod", "drizzle-orm", "qdrant-client" |
Architecture |
An architectural pattern or decision |
"MCP for tool integration", "SSE for real-time events" |
CodePattern |
A coding pattern or convention |
"avoid let statements", "use Bun APIs" |
ErrorSolution |
A problem and its resolution |
"CORS error fixed by adding proxy headers" |
FileComponent |
A significant file or module |
"session.tsx", "serve-ui.ts" |
DeploymentConfig |
A deployment or infrastructure detail |
"s6-overlay for process supervision", "port 4096 for API" |
Preference |
A user or team preference |
"TypeScript over JavaScript", "single-word variable names" |
Procedure |
A workflow or process |
"deploy with docker compose up", "run bun run dev for local dev" |
Configuration
- Define as Pydantic models compatible with Graphiti's entity type system
- Include descriptions for each type that guide the LLM extraction
- Configure which types are used for extraction vs. just categorization
- Test with sample coding session transcripts to verify extraction quality
Extraction Tuning
- Consider adding extraction prompt customization if Graphiti supports it
- Ensure code snippets, file paths, and error messages are preserved in entity attributes
- Verify temporal invalidation works correctly (e.g., "switched from Express to Hono" invalidates old Framework entity relationships)
Files to create/modify
memory/entity_types.py — custom Pydantic entity type definitions
memory/docker-compose.yml — reference entity types config in Graphiti service (if needed)
memory/README.md — document custom entity types and their purpose
Reference
- Graphiti custom entity types: https://github.com/getzep/graphiti (check docs for
EntityType Pydantic models)
- Default entity types in Graphiti: Preference, Requirement, Procedure, Location, Event, Organization, Document, Topic, Object
- Graphiti MCP server
config.yaml may support entity type customization
Acceptance Criteria
Context
Graphiti extracts entities and relationships from text using LLM-powered pipelines. By default, it uses generic entity types (Preference, Requirement, Procedure, Location, Event, Organization, Document, Topic, Object). For coding sessions, we need custom entity types that better capture the domain-specific knowledge we want to remember.
This ensures that the knowledge graph is structured in a way that makes retrieval useful for future coding sessions.
Goal
Define and configure custom Pydantic entity types in Graphiti that are optimized for coding session knowledge extraction.
Requirements
Entity Types to Define
ProjectFrameworkLibraryArchitectureCodePatternErrorSolutionFileComponentDeploymentConfigPreferenceProcedureConfiguration
Extraction Tuning
Files to create/modify
memory/entity_types.py— custom Pydantic entity type definitionsmemory/docker-compose.yml— reference entity types config in Graphiti service (if needed)memory/README.md— document custom entity types and their purposeReference
EntityTypePydantic models)config.yamlmay support entity type customizationAcceptance Criteria
search_nodeswithentity_types=["ErrorSolution"])