Company Context for OpenAnalyst
Company Context is the business, operating, and project context that OpenAnalyst should use when working inside a 10x handle or Smartwork project. Store it in the handle knowledge base and retrieve it through documented 10xKB API or MCP surfaces.
Company Context is not a private OpenAnalyst database, a direct 10xDotIn table read, or a replacement for live provider tools. The 10x handle is the hard authorization boundary. projectId and containerTags only narrow results inside that handle.
What to store
Good Company Context is durable enough for an agent to reuse across sessions:
- company profile, business model, product lines, and target buyers
- operating constraints, escalation rules, and campaign guardrails
- project-specific launch facts, repository/runbook references, and approved decisions
- support, sales, marketing, and onboarding context that should be retrieved consistently
Do not store provider secrets, OAuth tokens, webhook secrets, private customer data that is not approved for retrieval, or facts that must be fresh to the second.
Two ingestion lanes
| Lane | Use it for | 10x surface | OpenAnalyst retrieval |
|---|---|---|---|
| Manual KB documents | Approved company facts, playbooks, policies, and operator-authored context | /v2/handles/{handle}/knowledge/documents and /v2/handles/{handle}/knowledge/query | knowledge_query or direct /knowledge/query |
| Context Store sources | Replicated read-only connector records such as docs, pages, code, and exported records | /v2/handles/{handle}/context-sources* and /v2/handles/{handle}/context-store/search | context_store_status then context_store_search |
| Function bindings | Live reads, writes, provider actions, and current-state checks | /v2/handles/{handle}/function-bindings* and hosted MCP tools | provider-specific tool or binding invocation |
Use manual KB documents for the canonical production Company Context. Use Context Store only for replicated connector context after checking source/entity status. Use function bindings when the workflow needs writes or real-time freshness.
Document contract
Use one topic for reusable company context:
company-context
Use containerTags only when the context belongs to a Smartwork/OpenAnalyst project:
["smartwork_project_<projectId>"]
For handle-wide company context, omit containerTags. For project-scoped context, use the same project id that OpenAnalyst receives from Smartwork launch/runtime context so retrieval stays in the same project subspace.
Recommended metadata:
{
"companyId": "gharart",
"companyName": "Gharart.com",
"projectId": "gharart_ops_lab",
"scope": "project",
"source": "company-context",
"lifecycle": "approved",
"audience": "openanalyst"
}
Do not use topic: "openanalyst-10xmemory" for Company Context. That topic is reserved for OpenAnalyst 10Xmemory project/user memories written by the 10Xmemory plugin.
Gharart example
The existing Gharart reference company is a reusable example for Company Context. It is a multi-category home and lifestyle ecommerce storefront with seasonal campaigns, paid traffic, affiliate referrals, repeat buyer cohorts, campaign-level attribution, ad intelligence, and automated merchandising needs.
Set variables:
export API_BASE="https://ai.10x.in"
export HANDLE="gharart"
export JWT_TOKEN="<jwt-token>"
export PROJECT_ID="gharart_ops_lab"
export PROJECT_TAG="smartwork_project_gharart_ops_lab"
Create a project-scoped Company Context document:
curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/knowledge/documents" \
-H "authorization: Bearer ${JWT_TOKEN}" \
-H "content-type: application/json" \
-d "{
\"title\": \"Gharart.com operating context\",
\"topic\": \"company-context\",
\"source\": \"company-context\",
\"contentType\": \"text/plain\",
\"tags\": [\"company-context\", \"openanalyst\", \"gharart\", \"ecommerce\"],
\"containerTags\": [\"${PROJECT_TAG}\"],
\"metadata\": {
\"companyId\": \"gharart\",
\"companyName\": \"Gharart.com\",
\"projectId\": \"${PROJECT_ID}\",
\"scope\": \"project\",
\"source\": \"company-context\",
\"lifecycle\": \"approved\",
\"audience\": \"openanalyst\"
},
\"content\": \"Gharart.com is a multi-category home and lifestyle ecommerce storefront. It runs high-velocity seasonal campaigns, combines paid traffic, affiliate referrals, and repeat buyer cohorts, and depends on campaign-level attribution, ad intelligence, and automated merchandising. Domain cutovers and landing page releases must be rollback-safe.\"
}"
Query the project-scoped context:
curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/knowledge/query" \
-H "authorization: Bearer ${JWT_TOKEN}" \
-H "content-type: application/json" \
-d "{
\"query\": \"What operating constraints should OpenAnalyst consider for Gharart campaigns?\",
\"topic\": \"company-context\",
\"containerTags\": [\"${PROJECT_TAG}\"],
\"filters\": {
\"AND\": [
{ \"key\": \"companyId\", \"value\": \"gharart\" },
{ \"key\": \"lifecycle\", \"value\": \"approved\" }
]
},
\"limit\": 5
}"
Expected result: the response includes ranked results[], retrieval metadata, and the Gharart document. If results[] is empty immediately after create, retry after indexing catches up and verify the document is visible through the list/get routes.
Context Store example
When a company context source is connector-backed, create a Context Store source and search only after readiness is READY or PREVIEW.
curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/context-sources" \
-H "authorization: Bearer ${JWT_TOKEN}" \
-H "content-type: application/json" \
-d "{
\"sourceId\": \"gharart_company_context\",
\"projectId\": \"${PROJECT_ID}\",
\"connectorKey\": \"upstream_mcp_resource\",
\"selectedEntities\": [\"records\"],
\"refreshPolicy\": { \"mode\": \"manual\" },
\"config\": {
\"records\": [
{
\"id\": \"gharart_context_v1\",
\"entity\": \"records\",
\"title\": \"Gharart.com company context\",
\"content\": \"Gharart.com needs campaign-level attribution, ad intelligence, rollback-safe releases, and scoped partner access.\",
\"fields\": {
\"companyId\": \"gharart\",
\"lifecycle\": \"approved\"
}
}
],
\"pageSize\": 50
}
}"
Check status:
curl -sS "${API_BASE}/v2/handles/${HANDLE}/context-sources" \
-H "authorization: Bearer ${JWT_TOKEN}"
Search Context Store:
curl -sS -X POST "${API_BASE}/v2/handles/${HANDLE}/context-store/search" \
-H "authorization: Bearer ${JWT_TOKEN}" \
-H "content-type: application/json" \
-d "{
\"projectId\": \"${PROJECT_ID}\",
\"sourceId\": \"gharart_company_context\",
\"entity\": \"records\",
\"query\": \"campaign-level attribution and rollback-safe releases\",
\"limit\": 5
}"
If the source is FAILED, DISABLED, or still LOADING, OpenAnalyst should not answer as if the connector context is current. Fall back to approved manual KB documents or a live function binding.
MCP usage
Grant only the scopes needed for the workflow:
mcp.connectknowledge.queryforknowledge_querycontext_store.searchforcontext_store_searchandcontext_store_statuscontext_store.manageonly when the assistant should request refreshes throughcontext_source_sync
Useful prompts:
- "Use
knowledge_queryon topiccompany-contextfor projectgharart_ops_labbefore planning the campaign." - "Run
context_store_statusfirst. If the Gharart source isREADYorPREVIEW, usecontext_store_searchfor connector records." - "If Context Store is stale or unavailable, say that and use approved manual 10xKB Company Context instead."
OpenAnalyst consumption rules
OpenAnalyst Package should consume Company Context through 10xKB APIs or MCP tools only:
- Resolve API base URL, handle, token,
projectId, andworkspaceIdfrom Smartwork runtime context or explicit local smoke config. - Build the exact project container tag, for example
smartwork_project_gharart_ops_lab. - Query
topic: "company-context"with thatcontainerTagsvalue for project context. - Query without
containerTagsonly when handle-wide company context is intended. - Use
context_store_statusbeforecontext_store_searchfor replicated connector data. - Keep 10Xmemory writes on
topic: "openanalyst-10xmemory"separate from Company Context reads.
Related
Updated Jun 19, 2026
