AgentCortex is a Go-native memory infrastructure for AI agents, providing persistent storage, semantic recall, and structured memory management.
Run the Gin server:
go run .\cmd\agent-cortexYou can also load a YAML file:
go run .\cmd\agent-cortex --config .\config.ymlThe service listens on :8080 by default. Set ADDR or DATABASE_PATH to override the listen address or SQLite database path.
Set EMBEDDING_PROVIDER or EMBEDDING_ENDPOINT to override the search embedding provider or endpoint. Environment variables override values loaded from the YAML config file.
Example config.yml:
addr: ":8080"
database_path: "agent_memory.db"
storage_backend: "sqlitevec"
embedding_provider: "static"
embedding_endpoint: "http://127.0.0.1:8081"
model_provider: "openai-compatible"
model_endpoint: ""
model_api_key: ""
model_name: ""
model_timeout: "30s"
server_endpoint: "http://127.0.0.1:8080"Run the interactive CLI:
go run .\cmd\agent-cortex-cli --config .\config.ymlThe CLI is a separate entrypoint from the HTTP server and connects to the HTTP QA server:
server_endpoint: "http://127.0.0.1:8080"
agent_id: "agent-cortex-cli"
user_id: "default-user"
system_prompt: "You are a concise assistant."Each successful Q/A turn is automatically saved as memory by the server. Environment variables still override YAML values.
GET /healthPOST /api/v1/memories
Content-Type: application/json
{
"id": "mem_001",
"agent_id": "agent_001",
"user_id": "user_001",
"question": "What does the user like?",
"answer": "The user likes building agent memory in Go.",
"embedding": [0.1, 0.2, 0.3, 0.4]
}POST /api/v1/memories/search
Content-Type: application/json
{
"agent_id": "agent_001",
"user_id": "user_001",
"question": "What does the user like?",
"limit": 10
}